Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hassan11196/go-starter
Basic Hello World Programs for Go.
https://github.com/hassan11196/go-starter
go golang hello-world
Last synced: 5 days ago
JSON representation
Basic Hello World Programs for Go.
- Host: GitHub
- URL: https://github.com/hassan11196/go-starter
- Owner: hassan11196
- Created: 2020-02-11T19:09:55.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-24T18:51:58.000Z (over 4 years ago)
- Last Synced: 2023-03-04T10:32:20.137Z (over 1 year ago)
- Topics: go, golang, hello-world
- Language: Go
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go Starter
Basic Hello World Programs for Go.
### Run a Go Program:go run hello-world.go
### Create a Binary:go build hello-world.go
### Work-space directory structure
A Go workspace must have three sub-directories.
/bin --> binary exectutables generated by go install
/pkg --> Compiled Package Objects
/src --> Source Code
- package object save compilation time. 3rd party packages are also installed in /pkg directory.
- go install creates packages objects of any imported packages. go install internally calls go build### Installing Third Party Package:
go get github.com/jinzhu/gorm
### Creating Binaries for Workspaces :
/*
This Requires setting up the GOPATH and GOBIN environment variables.
where
GOPATH = .../GoWorkspaceName
GOBIN = .../GoWorkspaceName/bin
*/
go install hello
/*
Above command will build main/src/hello/main.go
A binary file will be generated inside bin directory with the name of the package.
*/
## References :
- [https://medium.com/rungo/working-in-go-workspace-3b0576e0534a](https://medium.com/rungo/working-in-go-workspace-3b0576e0534a)
- [https://gobyexample.com/](https://gobyexample.com/)
- [https://awesome-go.com/](https://awesome-go.com/)