Go Recipes: Difference between revisions
Jump to navigation
Jump to search
Line 20: | Line 20: | ||
* TCP client and server with <tt>[[Go Package net|net]]</tt> primitives: [https://github.com/NovaOrdis/playground/blob/master/go/network/tcp-server.go playground/go/network/tcp-server.go], [https://github.com/NovaOrdis/playground/blob/master/go/network/tcp-client.go playground/go/network/tcp-client.go], | * TCP client and server with <tt>[[Go Package net|net]]</tt> primitives: [https://github.com/NovaOrdis/playground/blob/master/go/network/tcp-server.go playground/go/network/tcp-server.go], [https://github.com/NovaOrdis/playground/blob/master/go/network/tcp-client.go playground/go/network/tcp-client.go], | ||
* HTTP server with <tt>[[Go Package net|net/http]]</tt> primitives: [https://github.com/NovaOrdis/playground/blob/master/go/network/http-server.go playground/go/network/http-server.go] | * HTTP server with <tt>[[Go Package net|net/http]]</tt> primitives: [https://github.com/NovaOrdis/playground/blob/master/go/network/http-server.go playground/go/network/http-server.go] | ||
* HTTP client with <tt>[[Go Package net|net/http]]</tt> and <tt>[[Go Package io|ioutil]]</tt> primitives: [https://github.com/NovaOrdis/playground/blob/master/go/network/http-client.go playground/go/network/http-client.go] | * HTTP client with <tt>[[Go Package net|net/http]]</tt> and <tt>[[Go Package io|ioutil]]</tt> primitives: [https://github.com/NovaOrdis/playground/blob/master/go/network/http-client.go playground/go/network/http-client.go] <font color=red>More HTTP details in "Go in Action" page 65.</font> | ||
* RPC - Introducing Go page 89 | * RPC - Introducing Go page 89 |
Revision as of 04:17, 4 April 2016
Internal
Files
- Reading a file with os primitives: playground/go/files/read-file.go
- Readinga file with io/ioutil primitives: playground/go/files/read-file-2.go
- Writing a file with os primitives: playground/go/files/write-file.go
- Writing a file with io/ioutil primitives: playground/go/files/write-file-2.go
- Reading a directory with os primitives: playground/go/files/read-dir.go
- Walking a directory with path/filepath primitives: playground/go/files/walk-dir.go
Network
- TCP client and server with net primitives: playground/go/network/tcp-server.go, playground/go/network/tcp-client.go,
- HTTP server with net/http primitives: playground/go/network/http-server.go
- HTTP client with net/http and ioutil primitives: playground/go/network/http-client.go More HTTP details in "Go in Action" page 65.
- RPC - Introducing Go page 89
Command Line Parsing
Concurrency
- Unbuffered channel: playground/go/concurrency/unbuffered-channel.go
- Using a waitGroup to wait for goroutines to finish before exiting main(): playground/go/concurrency/waitGroup.go