Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ramaraju-personal-org/go_basics
This repo has detailed explanation about golang basics
https://github.com/ramaraju-personal-org/go_basics
arrays concurrency constructors control-structures for-loops functions goroutines interfaces json-conversion maps methods pointers slice struct-tags structure variadic-functions
Last synced: 4 days ago
JSON representation
This repo has detailed explanation about golang basics
- Host: GitHub
- URL: https://github.com/ramaraju-personal-org/go_basics
- Owner: RamaRaju-personal-org
- Created: 2024-05-24T20:51:41.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-17T23:45:19.000Z (4 months ago)
- Last Synced: 2024-07-18T05:32:53.687Z (4 months ago)
- Topics: arrays, concurrency, constructors, control-structures, for-loops, functions, goroutines, interfaces, json-conversion, maps, methods, pointers, slice, struct-tags, structure, variadic-functions
- Language: Go
- Homepage: https://go.dev/doc/
- Size: 3.29 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go Basics
> \[!NOTE]\
> First go to the folder where the go file is present.- ##### To run a go application in development :
```bash
go run firstCode.go
```
- ##### In production :```bash
# initialize the module (on MacOS)
go mod init /path/to/your/goFile/customModuleName
# build the module
go build
# Run the module and get the executable file (on MacOS)
./customModuleName
```
- Go has modules and each module has multiple packages
- Should have atleast one package in a file
- A single package can be split accross multiple go files
- Can have multiple packages in one go file also
- [Go standard libraby for packages](https://pkg.go.dev/std)![packages](images/pacakgesInGo.png)
![packages](images/example.png)