The Go Programming Language

Source file doc/progs/print.go

     1	// Copyright 2009 The Go Authors. All rights reserved.
     2	// Use of this source code is governed by a BSD-style
     3	// license that can be found in the LICENSE file.
     4	
     5	package main
     6	
     7	import "fmt"
     8	
     9	func main() {
    10		var u64 uint64 = 1<<64 - 1
    11		fmt.Printf("%d %d\n", u64, int64(u64))
    12	
    13		// harder stuff
    14		type T struct {
    15			a int
    16			b string
    17		}
    18		t := T{77, "Sunset Strip"}
    19		a := []int{1, 2, 3, 4}
    20		fmt.Printf("%v %v %v\n", u64, t, a)
    21		fmt.Print(u64, " ", t, " ", a, "\n")
    22		fmt.Println(u64, t, a)
    23	}

release.r60.3. Except as noted, this content is licensed under a Creative Commons Attribution 3.0 License.