@Jan: that does not work; I used this example:
@xao: slight change: when using sort.Sort(Courses(courses)) it does work!
Thanks to you both! Here is the working version:
2016-09-20 22:14 GMT+02:00 xingtao zhao <zhaoxing...@gmail.com>:
> On Tuesday, September 20, 2016 at 10:50:15 AM UTC-7, Jan Mercl wrote:
>> Types Course and Courses are distinct types. courses have type
>> Courses because that's what the parameter to make is. Change it to
>> Courses, ie.
>> courses := make(Courses, maxrow)
>> On Tue, Sep 20, 2016, 19:44 Arie van Wingerden <xap...@gmail.com> wrote:
>>> Still a beginner ... first take at a bit more difficult thing.
>>> I cannot get this https://play.golang.org/p/qgBLH0r_vq to work.
>>> Compiler says:
>>> cannot use courses (type Course) as type sort.Interface in argument to
>>> Course does not implement sort.Interface (missing Len method)
>>> However, I thought I need the Len method for Courses instead of
>>> Pleas help.
>>> You received this message because you are subscribed to the Google
>>> Groups "golang-nuts" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to golang-nuts...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.