4 ms·
There is no required cargo.toml equivalent for go. You put all dependencies at the top of your source code in an import statement. There are other things you ca
by pclmulqdq 3y ago
There is no required cargo.toml equivalent for go. You put all dependencies at the top of your source code in an import statement. There are other things you can do if you want to lock a specific version of an API.
- TheDong 3y agoOkay, let me try that: $ echo -e 'package main\n\nimport _ "golang.org/x/image/draw"' > main.go $ go run main.go main.go:3:8: no required module provides package golang.org/x/image/draw: go.mod file not found in current directory or any parent directory; see 'go help modules' $ go build main.go <same error> go.mod seems pretty required. With rust, you can also technically just call 'rustc' and never use 'cargo', but just like it's a pain to do that in go, it's a pain to do that in rust.
- silisili 3y agoWith Go at least, just prepend GO111MODULE=off and it works. A bit esoteric, but I like that option, especially when working on an application and its dependencies in parallel at times.