go/

directory
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2020 License: Apache-2.0

README

Quickstart

The golang package management is a bit complicated (https://golang.org/doc/code.html). Below is how to have a quickstart to use sample go codes in github.com/hermantai/samples/go.

First, make sure you like your GOPATH:

$ go env GOPATH

Then, install the hello program (it's hello.go inside a hello directory):

$ go install github.com/hermantai/samples/go/hello

You can also omit the full package path if you are already inside the samples/go/hello directory.

You can then execute the program with:

$ $GOPATH/bin/hello

If you havn't clone the repository and put it in your GOPATH, you should use "go get" instead:

$ go get github.com/hermantai/samples/go/hello
$ $GOPATH/bin/hello

You can also run a go program directly by going to the directory, then run:

$ samples/go/timestamp$ go run timestamp.go

Directories

Path Synopsis
base is a basic demo of a Go program.
base is a basic demo of a Go program.
chainofios (Chain of IOs) demos how to start a web server, an rpc server, and a general purpose tcp server.
chainofios (Chain of IOs) demos how to start a web server, an rpc server, and a general purpose tcp server.
Package commonutil contains utilities for console like printing a header, etc.
Package commonutil contains utilities for console like printing a header, etc.
datastructsandalgos
datastructs
Samples for data structures, like lists, tuples, heaps, etc.
Samples for data structures, like lists, tuples, heaps, etc.
eatingrace is a demo of concurrency in Go using math/rand, sync.Once, time.Tick, time.After, goroutines and channels.
eatingrace is a demo of concurrency in Go using math/rand, sync.Once, time.Tick, time.After, goroutines and channels.
grpcsamples
helloworld/greeter_client
Package main implements a client for Greeter service.
Package main implements a client for Greeter service.
helloworld/greeter_server
Package main implements a server for Greeter service.
Package main implements a server for Greeter service.
hello is a demo of printing a string with a function defined in another package stringutil.
hello is a demo of printing a string with a function defined in another package stringutil.
Package stringutil demonstrates how to define a package besides main.
Package stringutil demonstrates how to define a package besides main.
hello is a demo of printing a string with a function defined in another package stringutil.
hello is a demo of printing a string with a function defined in another package stringutil.
tour
hello
Command hello is a bunch of simple snippets from the tour of Go.
Command hello is a bunch of simple snippets from the tour of Go.
webserver demos how to start a simple HTTP server.
webserver demos how to start a simple HTTP server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL