Re: [fossil-users] Using fossil with Golang (go get)

2018-06-19 Thread Zack Scholl
Hi Carlo,

Actually chiselapp.com is a special case. They included it specifically as
a pre-defined VCS path [1].

So to get it work with your own fossil, you should add the meta tag.

[1]:
https://github.com/golang/go/blob/master/src/cmd/go/internal/get/vcs.go#L1009-L1015



On Tue, Jun 19, 2018 at 8:53 AM Carlo Miron  wrote:

> On Tue, Jun 19, 2018 at 8:54 AM, Mark Janssen (fossil)
>  wrote:
>
> > 
>
> Has someone managed to make `go get` work with `hydra.ecd.space`?
>
> `chiselapp.com` works out of the box, even without the `` trickery:
>
> $ GOPATH=/tmp/go go get chiselapp.com/user/C8E/repository/go
> $ /tmp/go/bin/go
> hello world
>
> but I can't find a way to make it work on Hydra.
>
> Anyone?
>
> Thanks,
> ㎝
>
> --
> | THE BEER-WARE LICENSE (Revision 42)
> | --
> |  wrote this mail. As long as you retain
> | this notice you can do whatever you want with this stuff.
> | If we meet some day, and you think this stuff is worth it,
> | you can buy me a beer in return. -- Carlo Miron
>
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Using fossil with Golang (go get)

2018-06-19 Thread Carlo Miron
On Tue, Jun 19, 2018 at 8:54 AM, Mark Janssen (fossil)
 wrote:

> 

Has someone managed to make `go get` work with `hydra.ecd.space`?

`chiselapp.com` works out of the box, even without the `` trickery:

$ GOPATH=/tmp/go go get chiselapp.com/user/C8E/repository/go
$ /tmp/go/bin/go
hello world

but I can't find a way to make it work on Hydra.

Anyone?

Thanks,
㎝

-- 
| THE BEER-WARE LICENSE (Revision 42)
| --
|  wrote this mail. As long as you retain
| this notice you can do whatever you want with this stuff.
| If we meet some day, and you think this stuff is worth it,
| you can buy me a beer in return. -- Carlo Miron
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Using fossil with Golang (go get)

2018-06-19 Thread Mark Janssen (fossil)

On 2018-06-18 23:42, Zack Scholl wrote:

Hi Mark,

The meta tag

 

will not work for importing Go code. The first term needs to match the
import path, e.g. "X" in the `go get X` command. And "http(s)://" is
not allowed in the import path for `go get`.

Is there a fossil variable similar to "$baseurl" for the base URL
without the http(s):// ? That could be used instead to replace the
first $baseurl in that meta tag and serve as a valid import path.



I could have sworn this worked when I tested it :) . I don't think the 
variable you want exists, but you can use the following instead:





Mark
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Using fossil with Golang (go get)

2018-06-18 Thread Zack Scholl
Hi Mark,

The meta tag



will not work for importing Go code. The first term needs to match the
import path, e.g. "X" in the `go get X` command. And "http(s)://" is not
allowed in the import path for `go get`.

Is there a fossil variable similar to "$baseurl" for the base URL without
the http(s):// ? That could be used instead to replace the first $baseurl
in that meta tag and serve as a valid import path.

Sincerely,

Zack

P.S. I hope this email reply worked to go on the mailing list correctly,
I'm new at this.
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Using fossil with Golang (go get)

2018-06-18 Thread Mark Janssen (fossil)

On 2018-06-17 14:57, Zack Scholl wrote:


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  tags:

https://yourdomain.com/hello-world;>



Works very well, thank you.
To add, easier and repo independent is: content="$baseurl fossil $baseurl">

IMO this would be a nice candidate for inclusion in the standard skins.

---
Mark
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] Using fossil with Golang (go get)

2018-06-17 Thread Zack Scholl
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  tags:

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