top | item 15623367

(no title)

jeffinhat | 8 years ago

This is awesome. I've been trying to reach for go instead of bash more and more and this is exactly what I need for the small stuff.

Any ideas how it could relate to the go toolchain? could I stick my Neugram files in a repo and go get them?

discuss

order

crawshaw|8 years ago

The relation to the go toolchain right now is your GOPATH is used to find Go packages when you import them. (It uses the go tool to build the package as a plugin for loading.)

You certainly could put your Neugram files in the same git repository as your Go code, and then "go get" would get them.

I think there is something to be said for something like:

    import "github.com/crawshaw/foo/mypkg.ng"
looking for the .ng file in your GOPATH. I need to think about that a bit more.

(Note that a Neugram package is limited to a single file, unlike a Go package. This is for a couple of practical reasons, notably init order, and one philosophical reason: which is Neugram packages shouldn't get as big as Go packages.)