Giter Site home page Giter Site logo

letsgo's Introduction

This guy finally starts to learn GO.

Why GO

This is a response to issue#1 link.

Refer to this article.

  • Fast-paving compilation and execution
  • Do away with the need of working with different subsets of languages for one project.
  • A boost to code readability and documentation
  • Offering a thoroughly consistent language
  • Facilitating easy versioning of the program
  • Allowing developing with multiple languages
  • Allowing easier maintenance of dependencies

Any personal reasons? Yes, of course. I am just too bored that I want to learn something different and all. Thanks, @PragmaTwice.

Resources

Setup

  • Installation: For Windows users, it is recommeded to install via a .msi file.
    • for mac: brew install go
  • Add $GOROOT/bin into your $PATH if you want to make go compiler directly executable. (ignore this step if you are using a package manager / .msi on Windows)
  • Set $GOPATH to somewhere you want to put all your go files.
  • go get -v github.com/nsf/gocode to set up your $GOPATH (by installing a package).
  • You can also manually set up $GOPATH:
    1. mkdir src && mkdir bin && mkdir pkg
    2. Put your projects under the src folder.

You may not want to touch GOROOT where the go compiler packages locate. Change it if you need different versions of GOs.

More about GOPATH: It is OK to have more than one $GOPATH. If you have multiple GOPATH entries, only the first one will be used for downloading source codes(i.e., go get), but all you entries can be searched for source codes.

Proxy

go env -w GO111MODULE=on
go env -w GOPROXY="https://goproxy.io,direct"

# Set environment variable allow bypassing the proxy for selected modules (optional)
go env -w GOPRIVATE="*.corp.example.com"

# Set environment variable allow bypassing the proxy for specified organizations (optional)
go env -w GOPRIVATE="example.com/org_name"

See https://goproxy.io/ for details.

Install this repo

### Uniform approach
go get -v github.com/ganler/LetsGO

### For Windows PowerShell users:
cd $Env:GOPATH\src
mkdir -p github.com && cd github.com
mkdir -p ganler && cd ganler
git clone https://github.com/ganler/LetsGO.git

### For non-Windows users:
cd $GOPATH/src
mkdir -p github.com && cd github.com
mkdir -p ganler && cd ganler
git clone https://github.com/ganler/LetsGO.git

Basic CMDs

go version
go env  # see the env vars.
go get -v XXX # The `v` flag is for looking at details of downloading.

Run your codes:

go run basics/01_helloworld/main.go  # Compile & run

# Traditional Pipeline:
# Go to your main.go folder && create a module
cd basics/01_helloworld
go mod init basics/01_helloworld
go install basics/01_helloworld # Put the executable file(main function) into the `bin` folder.
# Or: go install` means `go install .`

# After installation, you can find your executable program(named afted the module name) on your `bin` folder if you have any main functions in your file.

Tutorial

Docs

Standards

Conventional commits

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]
  • $description: should be imperitive. (e.g., add instead of added)
  • $type: fix | feat | build | refactor | test | BREAKINGCHANGE
  • $type!: the ! means something breaking occured.
  • Examples:
fix: correct dead lock bug by variable lk
-------------------------------------------------
feat(basic): add code example about printing`
-------------------------------------------------
fix: correct minor typos in codes

see the issue for details

Reviewed-by: XZT
Refs #233

letsgo's People

Contributors

ganler avatar

Watchers

 avatar  avatar

letsgo's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.