I have package udamy
under udamy i have to two source files
-------------main.go------------------
package main
import “fmt”
func main(){
fmt.println(“main”)
ss() //calling ss() function
}
---------hey.go--------------------------
package main
import “fmt”
func ss(){
fmt.println(“ss”)
ss() //calling ss() function
}
Both are in the same package but if try to call ss func from main func its showing undfined
You try to run a single file main.go but you have a package. To run the package, do
$ go run .
inside the package directory.
See the documentation of the go run command for details.
Note: Please don’t post screenshots of code or command line output. Please also use the </> button at the top of the edit window on code snippets. This will render your code in a readable way.