// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Solve the 2,3,5 problem (print all numbers with 2, 3, or 5 as factor) using channels.
+// Test the solution, silently.
+
package main
type T chan uint64
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package main
-
// Test that error messages say what the source file says
// (uint8 vs byte, int32 vs. rune).
+// Does not compile.
+
+package main
import (
"fmt"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package main
-
// Test that dynamic interface checks treat byte=uint8
// and rune=int or rune=int32.
+package main
+
func main() {
var x interface{}
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// Semi-exhaustive test for append()
+// Semi-exhaustive test for the append predeclared function.
package main
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Test os.Args.
+
package main
import "os"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Verify simple assignment errors are caught by the compiler.
+// Does not compile.
+
package main
import "sync"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Verify assignment rules are enforced by the compiler.
+// Does not compile.
+
package main
type (
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Test the internal "algorithms" for objects larger than a word: hashing, equality etc.
+
package main
type T struct {
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Test behavior of maps with large elements.
+
package main
func seq(x, y int) [1000]byte {
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Test behavior of the blank identifier (_).
+
package main
import _ "fmt"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Test that incorrect uses of the blank identifer are caught.
+// Does not compile.
+
package _ // ERROR "invalid package name _"
func main() {
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Test the cap predeclared function applied to channels.
+
package main
func main() {
-// $G $F.go && $L $F.$A &&./$A.out
+// run
// 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.
+// Test character literal syntax.
+
package main
import "os"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Verify that illegal character literals are detected.
+// Does not compile.
+
package main
const (
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Test the behavior of closures.
+
package main
import "runtime"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Test equality and inequality operations.
+
package main
import "unsafe"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Verify that incorrect comparisons are detected.
+// Does not compile.
+
package main
func use(bool) {}
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Verify that incorrect invocations of the complex predeclared function are detected.
+// Does not compile.
+
package main
var (
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Test composite literals.
+
package main
type T struct {
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Verify that illegal composite literals are detected.
+// Does not compile.
+
package main
var m map[int][3]int
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Test that returning &T{} from a function causes an allocation.
+
package main
type T struct {
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Test simple boolean and numeric constants.
+
package main
const (
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Verify overflow is detected when using numeric constants.
+// Does not compile.
+
package main
type I interface{}
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Verify that large integer constant expressions cause overflow.
+// Does not compile.
+
package main
const (
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Test typed integer constants.
+
package main
import "fmt"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Test types of constant expressions, using reflect.
+
package main
import "reflect"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Verify that illegal conversions involving strings are detected.
+// Does not compile.
+
package main
type Tbyte []byte
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Verify allowed and disallowed conversions.
+// Does not compile.
+
package main
// everything here is legal except the ERROR line
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Verify that illegal assignments with both explicit and implicit conversions of literals are detected.
+// Does not compile.
+
package main
-// explicit conversion of constants is work in progress.
-// the ERRORs in this block are debatable, but they're what
-// the language spec says for now.
+// explicit conversion of constants
var x1 = string(1)
var x2 string = string(1)
var x3 = int(1.5) // ERROR "convert|truncate"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Verify that illegal uses of composite literals are detected.
+// Does not compile.
+
package main
var a = []int { "a" }; // ERROR "conver|incompatible|cannot"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// Semi-exhaustive test for copy()
+// Semi-exhaustive test for the copy predeclared function.
package main
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Test that zero division causes a panic.
+
package main
import (