0
0

Go言語でパッケージ呼び出し

Posted at

プログラムの構成

helloパッケージ
 |_ hello.go
main.go

helloパッケージ内の処理をmain.goで呼び出す

package main

import "Fyne01/Lesson1/hello"

func main() {
	hello.Hello()
}

Goで宣言できるパッケージは1つだけなので、他言語のようにいくつもパッケージで呼び出すことはできない。
代わりにimportを使って呼び出す。

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