PowerShell
1PowerShell 7.2.4 2Copyright (c) Microsoft Corporation. 3 4https://aka.ms/powershell 5Type 'help' to get help. 6 7PS C:\Users\user\ocero> go run . 8go: go.mod file not found in current directory or any parent directory; see 'go help modules' 9PS C:\Users\user\ocero>
go
1package main 2 3import "fmt" 4 5func main() { 6 fmt.Println("hello world") 7} 8
VSで新規mainプロジェクトを作成し、main.goを実行したいのですが、
go: go.mod file not found in current directory or any parent directory; see 'go help modules'
エラーが出てしまいます。
https://qiita.com/toshihirock/items/c660fd77f5f3cc47b560
上記参考にコマンドを試しましたが、以下エラーが出てしまいます
user@DESKTOP-FRDK0PF:/mnt/c/WINDOWS/system32$ mkdir hello-module mkdir: cannot create directory ‘hello-module’: Permission denied user@DESKTOP-FRDK0PF:/mnt/c/WINDOWS/system32$
VSでmain.goが実行できなかったので、ターミナルでも実行試しましたがだめでした。
vsで実行できる方法はありますでしょうか?
どうしたら実行できるのか教えていただきたいです




回答1件
あなたの回答
tips
プレビュー