1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Goで同じディレクトリ・パッケージも同じ関数を呼び出してもエラーが出る

Posted at

goでディレクトリもパッケージも同じなのにbuildでこける。

go run server.go

server.goと同じディレクトリにあるのに呼べないのなんで、、!!

ディレクトリはこんな感じ

├server.go
└data.go

server.goでdata.goのメソッド読んでいる

解決策

以下のコマンドで丸ごとbuildするらしい

go build

//または

go build server.go data.go
1
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?