Go run
breadchris.com
Go run
1–10 of 173 posts
Re: Go run
#2Use `go run .` instead - it's shorter and it works with multiple files
Re: Go run
#3Re: Go run
#4(It's only a subset of the JavaScript ecosystem, but you can import a lot of npms nowadays.)
Re: Go run
#5This 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
#6Re: Go run
#7Why? 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
#8This 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.
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.
Re: Go run
#9`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
#10`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