環境windows11
linux環境を構築するためにWSL2 + Ubuntu 20.04をインストールしました。
https://qiita.com/uchiko/items/64fb3020dd64cf211d4e
を参考にgo mod init で、初期化したいのですが、以下のようにエラーがでてしまいました。
$ go version go version go1.18.2 linux/amd64 $ go mod init go: cannot determine module path for source directory /mnt/c/WINDOWS/system32 (outside GOPATH, module path must be specified) Example usage: 'go mod init example.com/m' to initialize a v0 or v1 module 'go mod init example.com/m/v2' to initialize a v2 module Run 'go help mod init' for more information.
https://selfnote.work/20201119/programming/golang-with-permittion-denied-with-lambda/
上記を参考に以下実行しました
$ go.exe get -u github.com/aws/aws-lambda-go/cmd/build-lambda-zip go: go.mod file not found in current directory or any parent directory. 'go get' is no longer supported outside a module. To build and install a command, use 'go install' with a version, like 'go install example.com/cmd@latest' For more information, see https://golang.org/doc/go-get-install-deprecation or run 'go help get' or 'go help install'. ユーザー名@DESKTOP-FRDK0PF:/mnt/c/WINDOWS/system32$ ^M%USERPROFILE%\Go\bin\build-lambda-zip.exe -output main.zip main %USERPROFILE%Gobinbuild-lambda-zip.exe: command not foundp main ユーザー名@DESKTOP-FRDK0PF:/mnt/c/WINDOWS/system32$ 1 1: command not found ユーザー名@DESKTOP-FRDK0PF:/mnt/c/WINDOWS/system32$ %USERPROFILE%\Go\bin\build-lambda-zip.exe -output main.zip main -bash: fg: %USERPROFILE%Gobinbuild-lambda-zip.exe: no such job
go mod init を実行するために上記ためしましたが、解決できず、原因もわからないのですが、
教えていただきたいです

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2022/05/16 13:08
2022/05/17 01:54