$ 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
- Getting into Go
- Multiple reuturns:
returns.go
- Named return values:
named_return.go
- Read TCP status:
read_status.go
- HTTP GET:
http_get.go
- Multiple reuturns:
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 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!
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
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.
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 ./...