Follow

@thor

fwiw, you can define your own slice or map types in Go, eg.:

type foo []string
type bar map[int]string

which is for example used in the sort package [1] of the standard lib. you are free to add methods to those types. imho Go slices and maps are more like C arrays than Objects (i'll give that the maps aren't perfect). Go just isn't OOP like C++ or Java. if you want your own fancy container types, you have to build them.

i think the designers really done 90% right, which is more than many other languages i know (TCL is in the same league). with Go i at least got to keep my sanity, contrary to python etc. especially while deploying things.

then, i'm a hopeless unix fanboy.

[1] golang.org/pkg/sort/#example_

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.