Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A Collection of Simple Example go Programs.
Go Makefile

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
arrays
chanasyn Add godoc information.
chanfan01 Example code using channels based on Google I/O 2012 concurrency pres…
chanfan02 Example code using channels based on Google I/O 2012 concurrency pres…
chanfan03 Example code using channels based on Google I/O 2012 concurrency pres…
chanfan04 Example code using channels based on Google I/O 2012 concurrency pres…
chanfan05
chanfan06
chanfan07
chanfan08 Example code using channels based on Google I/O 2012 concurrency pres…
chanfanout Initial fanout examples.
chanfanout2
chanloop
chanrange
chanshunt
chanshunt_2
chansvr1 Add godoc information.
chansvr2
chansyn
chantest Add godoc information.
charshow
dateshow Add date format demo.
defer Add godoc information.
dtemplex1 Add several simple template examples.
dtemplex2 gofmt for lastest example.
envshow Add godoc information.
errtest
fib
fib_embellished Add godoc information.
fib_userop Add godoc information.
fileread
filescan Example of using bufio.Scanner.
flagdemo Add godoc information.
force_type Add godoc information.
func_lit
func_ret
gio12gs01
gio12gs02
gio12gs03
gio12gs04
gio12gs05 More sample code from Google I/O 2112, concurrency related.
gobdemo Demo of gob encoding.
gorsynchs Add godoc information.
gortns01 Add godoc information.
greddit Reformat printed output for readability.
gt044 Add godoc information.
gt045 Add godoc information.
hello
hello_small
httpserv Add godoc information.
interface_01
interface_02 Add godoc information.
interface_03
interface_04
interface_04a Twist on previous example with interface name explicitly coded in str…
interface_04b Interface example embellished, use slice instead of array.
list
list_struct Add godoc information.
loghello
maps
maps_merge
maps_ss
methods
netcon Add godoc information.
numbers
numconv
oltesta Add godoc information.
panrecov
rand_between
rangecopy
ranges Add godoc information.
recover
runpprof
shax Add godoc information.
shifter Add shift display program.
show64
showallocs Some additional examples.
showgo
showmac
showpprof
showsetcpus Some additional examples.
showtime
sigshow oops - gofmt on signal demo
sl3index
slappmult
sliceappt
slices Add godoc information.
sltricks Add godoc information.
ssl
stomptest
stringlens
strings_utils Add godoc information.
struct
switch_demo Embellish switch example a little.
symlshow Add godoc information.
symltest
tcp01 Add godoc information.
tcp02 Add godoc information.
tcp03
tcp04 Add godoc information.
tcp05
tcp06 Display remote address.
testgreek Add godoc information.
testppack
type_String Add godoc information.
unicloup
unicode_what
uniques Add godoc information.
urlshow
utfconv
xmlshow01 Additional display of unmarshalled XML.
xmlshow02 Another XML example, somewhat like go issue 3688.
xmlshow03 Unmarshal xml elements to a slice.
.gitignore
Makefile
README.mdown Update README for current go weekly.

README.mdown

Project go-samp, Samples of Simple go Language Programs

This is a collection of extremely simple examples of using the go programming language.

These samples were inspired primarily by the GoCourseDay#.pdf files previously available in the go distrubution. And some additional experiments. In particular experiments triggered by documentation provided in the go distribution.

Prerequisites

In essence, you need a working go environment, and a few small additions.

At the current HEAD of master, your go build should be at least: weekly.2012-02-07.

You need certain basic functions available to you in order to build and run these go programs.

These include:

  • the go compiler
  • the go linker
  • make

If you are not familiar with go, and want to install it and learn the language, see:

Additional Setup

In order to use the make system for these samples, you will need to have the $GOPATH environment variable properly defined. See the go documentation for details.

Although this system is still installed using make, the 'go' tool is used under the covers. If you require previous versions, please examine previous tags.

Adjust $GOPATH as necessary for your system.

Install

To install all these samples:

  • clone from or fork on github
  • cd to your base git repo directory
  • make packages
  • make

Other Education Resources

Something went wrong with that request. Please try again.