Import package (third party) from GitHub
Last updated
Was this helpful?
Last updated
Was this helpful?
Description This guide assumes that you already have created your own package in go and uploaded on GitHub, if you haven't then checkout and . For demonstration we will use package uploaded .
Explanation The package, in the repository (GoModule.go) uploaded on GitHub, consist of a function name hello which takes string argument and returns a formatted message along with string.
Below is our main package (In Go, application code that must be executed should be main package), where we must import and use function from the third party package (package other than standard library are called third party, in this case it is our package hosted on GitHub)
Now, type go run . in your command prompt you should see output as below