Initial commit
This commit is contained in:
14
first/explain/packages/what/bye.go
Normal file
14
first/explain/packages/what/bye.go
Normal file
@ -0,0 +1,14 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func bye() {
|
||||
fmt.Println("Bye!")
|
||||
}
|
14
first/explain/packages/what/hey.go
Normal file
14
first/explain/packages/what/hey.go
Normal file
@ -0,0 +1,14 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func hey() {
|
||||
fmt.Println("Hey!")
|
||||
}
|
25
first/explain/packages/what/main.go
Normal file
25
first/explain/packages/what/main.go
Normal file
@ -0,0 +1,25 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Println("Hello!")
|
||||
|
||||
// You can access functions from other files
|
||||
// which are in the same package
|
||||
|
||||
// Here, `main()` can access `bye()` and `hey()`
|
||||
|
||||
// It's because: bye.go, hey.go and main.go
|
||||
// are in the main package.
|
||||
|
||||
bye()
|
||||
hey()
|
||||
}
|
Reference in New Issue
Block a user