From 7677ea815dda07ea7a8a61c5726236574e4e3f49 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Thu, 11 Sep 2008 10:21:02 -0700 Subject: add sections about types and constants R=gri DELTA=133 (124 added, 0 deleted, 9 changed) OCL=15122 CL=15143 --- doc/progs/strings.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 doc/progs/strings.go (limited to 'doc/progs/strings.go') diff --git a/doc/progs/strings.go b/doc/progs/strings.go new file mode 100644 index 000000000..28553c26a --- /dev/null +++ b/doc/progs/strings.go @@ -0,0 +1,13 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +func main() { + s := "hello"; + if s[1] == 'e' { print("success") } + s = "good bye"; + var p *string = &s; + *p = "ciao"; +} -- cgit v1.2.3