Initial commit
This commit is contained in:
@ -0,0 +1,19 @@
|
||||
// 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
|
||||
|
||||
// there's no warning for package-level vars
|
||||
var packageLevelVar string
|
||||
|
||||
func main() {
|
||||
// unused variable error
|
||||
// var speed int
|
||||
|
||||
// if you use it, the error will be gone
|
||||
// fmt.Println(speed)
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
// 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
|
||||
|
||||
func main() {
|
||||
var speed int
|
||||
|
||||
// let's assign the variable to the blank-identifier
|
||||
// so that Go compiler won't get grumpy
|
||||
_ = speed
|
||||
}
|
Reference in New Issue
Block a user