Thread overview
Is there an alternative of `go get`
Aug 07, 2020
Ky-Anh Huynh
Aug 07, 2020
Cogitri
August 07, 2020
Hi everyone,

`go get` in Golang world has a simple way to fetch and install binary

```
$ go get github/foo/bar.git
$ export PATH=$PATH:$(go env GOPATH)/bin
$ bar --help
```

This saves a lot of time and setup. Is that an alternative when using dub?

Thanks a lot.
August 07, 2020
On Friday, 7 August 2020 at 07:17:25 UTC, Ky-Anh Huynh wrote:
> Hi everyone,
>
> `go get` in Golang world has a simple way to fetch and install binary
>
> ```
> $ go get github/foo/bar.git
> $ export PATH=$PATH:$(go env GOPATH)/bin
> $ bar --help
> ```
>
> This saves a lot of time and setup. Is that an alternative when using dub?
>
> Thanks a lot.

Hello,

you can use `dub build $name` to build the package. The resulting binary should be in $HOME/.dub/$name-$version/$name/bin then. You can also run the binary via `dub run $name -- $additional_args`, then you won't have to add that path to your PATH. If you haven't run `dub build $name` previously, `dub run $name` will do that for you.
August 07, 2020
On 8/7/20 3:28 AM, Cogitri wrote:
> On Friday, 7 August 2020 at 07:17:25 UTC, Ky-Anh Huynh wrote:
>> Hi everyone,
>>
>> `go get` in Golang world has a simple way to fetch and install binary
>>
>> ```
>> $ go get github/foo/bar.git
>> $ export PATH=$PATH:$(go env GOPATH)/bin
>> $ bar --help
>> ```
>>
>> This saves a lot of time and setup. Is that an alternative when using dub?
>>
> 
> Hello,
> 
> you can use `dub build $name` to build the package. The resulting binary should be in $HOME/.dub/$name-$version/$name/bin then. You can also run the binary via `dub run $name -- $additional_args`, then you won't have to add that path to your PATH. If you haven't run `dub build $name` previously, `dub run $name` will do that for you.

Having a way to configure the path would be really helpful. I'll add a request for dub.

-Steve