0
0

More than 3 years have passed since last update.

Goを使ってみた

Posted at

Goを使ってみた

最近はやりのGoを触ってみるべくチャレンジ

まずはGoをWindowsマシンにインストール

https://golang.org/dl/ のMicrosoft WindowsからGoをダウンロード
image.png

普通にインストール実施

適当なファイルを作成

main.go
package main

import "fmt"

func main() {
    fmt.Printf("hellohogefuga\n")
}

go run コマンド実行

>go run main.go
hellohogefuga

vscodeで実施

するとこんなエラーが。

go: go.mod file not found in current directory or any parent directory; see 'go help modules'
exit status 1
Process exiting with code: 1

そのフォルダで以下実行
```

go mod init <フォルダ名>
```

無事実行できた。

image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0