Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A Collection of Simple Example go Programs.
Go Makefile
Failed to load latest commit information.
arrays Add godoc information.
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 Example code using channels based on Google I/O 2012 concurrency pres…
chanfan06 Example code using channels based on Google I/O 2012 concurrency pres…
chanfan07 Example code using channels based on Google I/O 2012 concurrency pres…
chanfan08 Example code using channels based on Google I/O 2012 concurrency pres…
chanfanout Initial fanout examples.
chanfanout2 Initial fanout examples.
chanloop Add godoc information.
chanrange Add godoc information.
chanshunt Example code using channels based on Google I/O 2012 concurrency pres…
chanshunt_2 Channel shunt example, many comments.
chansvr1 Add godoc information.
chansvr2 Add godoc information.
chansyn Add godoc information.
chantest Add godoc information.
charshow Some additional examples.
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 Add godoc information.
fib Add godoc information.
fib_embellished Add godoc information.
fib_userop Add godoc information.
fileread Clarify file read with different line ends.
filescan Example of using bufio.Scanner.
flagdemo Add godoc information.
force_type Add godoc information.
func_lit Add godoc information.
func_ret Add godoc information.
gio12gs01 More sample code from Google I/O 2112, concurrency related.
gio12gs02 More sample code from Google I/O 2112, concurrency related.
gio12gs03 More sample code from Google I/O 2112, concurrency related.
gio12gs04 More sample code from Google I/O 2112, concurrency related.
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 Add godoc information.
hello_small Add godoc information.
httpserv Add godoc information.
interface_01 Add godoc information.
interface_02 Add godoc information.
interface_03 Add godoc information.
interface_04 Clarify interface example with changes to text output.
interface_04a Twist on previous example with interface name explicitly coded in str…
interface_04b Interface example embellished, use slice instead of array.
list Add godoc information.
list_struct Add godoc information.
loghello Add godoc information.
maps Add godoc information.
maps_merge Add godoc information.
maps_ss Add godoc information.
methods Add godoc information.
netcon Add godoc information.
numbers Add godoc information.
numconv Add godoc information.
oltesta Add godoc information.
panrecov Panic, recover and display stacktrace, from the net.
rand_between Embellish random number example, add benchmarks.
rangecopy Embellish rangecopy example.
ranges Add godoc information.
recover A recover example.
runpprof Demo generate a CPU profile.
shax Add godoc information.
shifter Add shift display program.
show64 Simple base64 encode / decode demonstration.
showallocs Some additional examples.
showgo Add os information to showgo.
showmac Add godoc information.
showpprof Show available profile names.
showsetcpus Some additional examples.
showtime Add godoc information.
sigshow oops - gofmt on signal demo
sl3index Demo 3-index slices in go 1.2.
slappmult Demo append multiple slices.
sliceappt Reformat source showing call chaining.
slices Add godoc information.
sltricks Add godoc information.
ssl Update ssl client examples...
stomptest Enhance printed output and error detection.
stringlens Add godoc information.
strings_utils Add godoc information.
struct Add godoc information.
switch_demo Embellish switch example a little.
symlshow Add godoc information.
symltest Add godoc information.
tcp01 Add godoc information.
tcp02 Add godoc information.
tcp03 Add godoc information.
tcp04 Add godoc information.
tcp05 Add godoc information.
tcp06 Display remote address.
testgreek Add godoc information.
testppack Add godoc information.
type_String Add godoc information.
unicloup Add godoc information.
unicode_what Cedilla example message clarify.
uniques Add godoc information.
urlshow URL parsing example.
utfconv Add godoc information.
xmlshow01 Additional display of unmarshalled XML.
xmlshow02 Another XML example, somewhat like go issue 3688.
xmlshow03 Unmarshal xml elements to a slice.
.gitignore Update ignore list.
Makefile URL parsing example.
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.