I noticed that there was some interest that Go started supporting fossil
[1]. I was really happy that this change came about too, but I hadn't tried
playing with it until now. I initially had a lot of trouble getting `go
get` to work with my fossil, and eventually found the very simple solution
which I'll share in case anyone else also gets stuck like me.

All you need to do is update your "Header" skin (Admin -> Skins) to include
a special meta tag that `go get` will fetch to interpret your fossil as a
Go library/program. For example, if you have a fossil hosted at
https://yourdomain.com/hello-world then you need to add the meta tag in
between the <head> tags:

<meta name="go-import" content="yourdomain.com/hello-world fossil
https://yourdomain.com/hello-world";>

There's an explanation in the Golang docs [2], but basically the first part
"yourdomain.com/hello-world" is the package to be fetched, "fossil" tells
Go which VCS to use, and "https://yourdomain.com/hello-world"; is the root.

Now you can just do `go get yourdomain.com/hello-world`.

[1]:
https://www.mail-archive.com/fossil-users@lists.fossil-scm.org/msg27038.html

[2]: https://golang.org/cmd/go/#hdr-Remote_import_paths
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to