Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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/)