Code Monkey home page Code Monkey logo

to-be-a-gopher's Introduction


Contents

Discovering

$ tree -L 2
.
โ”œโ”€โ”€ 00_WebServer
โ”‚ย ย  โ””โ”€โ”€ main.go
โ”œโ”€โ”€ 01_TryGo
โ”‚ย ย  โ””โ”€โ”€ main.go
โ”œโ”€โ”€ 02_Packages
โ”‚ย ย  โ”œโ”€โ”€ README.md
โ”‚ย ย  โ”œโ”€โ”€ fiboMain.go
โ”‚ย ย  โ”œโ”€โ”€ fibonacci
โ”‚ย ย  โ””โ”€โ”€ randomNumber
โ”œโ”€โ”€ 03_TypeDeduction
โ”‚ย ย  โ””โ”€โ”€ main.go
โ”œโ”€โ”€ 04_BasicFunction
โ”‚ย ย  โ”œโ”€โ”€ factorial
โ”‚ย ย  โ””โ”€โ”€ hanoi
โ”œโ”€โ”€ 05_String
โ”‚ย ย  โ”œโ”€โ”€ 1_hangul
โ”‚ย ย  โ”œโ”€โ”€ 2_HasConsonantSuffix
โ”‚ย ย  โ”œโ”€โ”€ 3_Example_printBytes_test.go
โ”‚ย ย  โ”œโ”€โ”€ 4_Modify_printBytes_test.go
โ”‚ย ย  โ””โ”€โ”€ 5_concatenate_test.go
โ”œโ”€โ”€ 06_Array+Slice
โ”‚ย ย  โ”œโ”€โ”€ 1_Example_array_test.go
โ”‚ย ย  โ”œโ”€โ”€ 2_Example_slicing_test.go
โ”‚ย ย  โ”œโ”€โ”€ 3_Appending_to_a_slice_test.go
โ”‚ย ย  โ”œโ”€โ”€ 4_slice_capacity_test.go
โ”‚ย ย  โ”œโ”€โ”€ 5_slice_duplication_test.go
โ”‚ย ย  โ”œโ”€โ”€ 6_slice_insert_test.go
โ”‚ย ย  โ””โ”€โ”€ 7_stack_test.go
โ”œโ”€โ”€ 07_Map
โ”‚ย ย  โ”œโ”€โ”€ 1_character_count.go
โ”‚ย ย  โ”œโ”€โ”€ 2_map_equality.go
โ”‚ย ย  โ”œโ”€โ”€ 3_maps_test.go
โ”‚ย ย  โ””โ”€โ”€ 4_set_test.go
โ”œโ”€โ”€ 08_Input+Output
โ”‚ย ย  โ””โ”€โ”€ 1_io_test.go
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ README.assets
โ”‚ย ย  โ””โ”€โ”€ golang.png
โ””โ”€โ”€ README.md

17 directories, 23 files

Practice

  • Getting into Go
    • Multiple reuturns: returns.go
    • Named return values: named_return.go
    • Read TCP status: read_status.go
    • HTTP GET: http_get.go


Documentation

Go is a statically typed, compiled programming language designed at Google.

The Go programming language is an open source project to make programmers more productive.

Go is expressive, concise, clean, and efficient.

Its concurrency mechanisms make it easy to write programs that get the most out of multicore and networked machines, while its novel type system enables flexible and modular program construction.

Go compiles quickly to machine code yet has the convenience of garbage collection and the power of run-time reflection.

It's a fast, statically typed, compiled language that feels like a dynamically typed, interpreted language.



gofmt

Introduction

Gofmt is a tool that automatically formats Go source code.

Gofmt'd code is:

  • easier to write: never worry about minor formatting concerns while hacking away,
  • easier to read: when all code looks the same you need not mentally convert others' formatting style into something you can understand.
  • easier to maintain: mechanical changes to the source don't cause unrelated changes to the file's formatting; diffs show only the real changes.
  • uncontroversial: never have a debate about spacing or brace position ever again!

Format your code

We recently conducted a survey of Go packages in the wild and found that about 70% of them are formatted according to gofmt's rules.

This was more than expected - and thanks to everyone who uses gofmt - but it would be great to close the gap.

To format your code, you can use the gofmt tool directly:

gofmt -w yourcode.go

Or you can use the "go fmt" command:

go fmt path/to/your/package


Compile and run Go program

go run [build flags] [-exec xprog] package [arguments...]

Run compiles and runs the named main Go package.

Command go run performs project's building under the hood and with flag --work (go run --work main.go) you can see the location of temporary build files.



Testing

Files containing tests should be called name_test, with the _test suffix. They should be alongside the code that they are testing.

To run the tests recursively call go test -v ./...



How to build your first web application with Go

https://freshman.tech/web-development-with-go/

to-be-a-gopher's People

Contributors

gunh0 avatar

Stargazers

Ian Park avatar

Watchers

James Cloos avatar  avatar

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.