// $G $D/$F.go && $L $F.$A && ./$A.out // 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() { var c string; a := `abc`; b := `xyz`; /* print a literal */ print `abc`; /* print a variable */ print b, "-"; /* catenate literals */ print `abc` + `xyz`, "-"; /* catenate variables */ print a+b, "-"; /* compare literals */ if `abc` == `xyz` || `abc` != "abc" || `abc` > `xyz` { panic "compare literals"; } /* compare variables */ if a == b || a != a || a > b { panic "compare variables"; } /* cat */ c = a+b; print c, "-"; /* catequal */ c = a; c += b; print c, "-"; /* clumsy evaluation */ c = b; c = a + c; print c, "-"; /* len */ if len(c) != 6 { panic "len ", len(c); } /* index strings */ for i:=0; i