summaryrefslogtreecommitdiff
path: root/doc/progs/strings.go
diff options
context:
space:
mode:
Diffstat (limited to 'doc/progs/strings.go')
-rw-r--r--doc/progs/strings.go13
1 files changed, 13 insertions, 0 deletions
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";
+}