Live data from Hacker News

Go run

breadchris.com

1–10 of 173 posts

Re: Go run

#2
`go run main.go` breaks if your `main` module is divided into multiple files.

Use `go run .` instead - it's shorter and it works with multiple files

Re: Go run

#3
This isn't a benefit of go, but rather a drawback of the counter-example of typescript... All tools generally designed to work for creating small utilities ({ba,z,...}sh, python, perl, go, swift, ...) have this feature.

Re: Go run

#4
For TypeScript, "deno run" seems much the same?

(It's only a subset of the JavaScript ecosystem, but you can import a lot of npms nowadays.)

Re: Go run

#5
post #3

This isn't a benefit of go, but rather a drawback of the counter-example of typescript... All tools generally designed to work for creating small utilities ({ba,z,...}sh, python, perl, go, swift, ...) have this feature.

Most of these examples don’t automatically fetch the dependencies. Having come from Python, Go’s tools are notably simple.

Re: Go run

#6
I don't think it's simple. Just `go run` would be far more simple. Right now I first have to figure out if its `go run .` or `go run cmd/main.go` or some other thing.

Re: Go run

#7
> Yeah, and then what happens if you want to use modern syntax like esmodule [...] You are going to have to use npm.

Why? Node's had built-in support for ES Modules for eons now.

Everything's easy when you stick to default tooling, duh, like `node run.js` or `go run.go`. You'll loose that `go run.go` the moment you need code generation.

Re: Go run

#8
post #3

This isn't a benefit of go, but rather a drawback of the counter-example of typescript... All tools generally designed to work for creating small utilities ({ba,z,...}sh, python, perl, go, swift, ...) have this feature.

Most of these examples don’t automatically fetch the dependencies. Having come from Python, Go’s tools are notably simple.

> Most of these examples don’t automatically fetch the dependencies.

Quite frankly, I don't want to automatically fetch dependencies at the same time I am running the code. IMO those should be separate steps, and combining them together in one is not a good idea.

Post reply on HN