It is the vscode golang project. Please use the linux (not macos) environment to compile and run all of the examples. The more concise the language, the more flexible it becomes.
In ubuntu, I use the vscode to go build, run, go run and clean the project.
To make the project easier to use, I created the tasks.json and launch.json files.
Using the keyboard shortcut "command + shift + B," you may choose between the commands
clean
, go build
, run
, and go run
for jobs in tasks.json.
Each options has the following meaning:
- go build. It will generate the executable file.
- run. It will execute the executable file created by the
go build
phase. - go run. The go source code will be executed directly in tasks.json.
- clean. It will remove all executable files.
To debug the various source codes, press the F5
button.
- Test Demo in VSCode
- Basic Grammar: Variable, Loop, Type System, Condition Branch, Pointer and Constant
- Collections: Array, Slice, Map, Set,Stack, and Queue
- String: Unicode, UTF-8, string and strconv Libraries
- Function: First-Citizen, Variable Parameters and Defer
- Object-Oriented Programming: Encapsolution using Struct, Polymorphism using Interface and Inheriance using Composition
- Error Handling
- Package
- Concurrency in Action using Shared Memory
- Concurrency in Action using Channel
- Unsafe Programming: Try not to use
We use the go module tool in the project to manage dependencies, which is also recommended by the golang community.
We may use the following commands to generate the go.mod
file for the various source code folds:
go mod init abcdabcd3899
To remove redundant dependencies, we utilize the following method:
go mod tidy
Please open pull requests if you want to add new features.
More information document of agreement