2012-02-17 08:49:30 +04:00
|
|
|
// errorcheck
|
2009-08-15 02:13:32 +04:00
|
|
|
|
|
|
|
// 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
|
|
|
|
|
|
|
|
type S struct {
|
|
|
|
a, b int
|
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
s1 := S{a: 7}; // ok - field is named
|
|
|
|
s3 := S{7, 11}; // ok - all fields have values
|
2009-08-24 20:23:04 +04:00
|
|
|
s2 := S{7}; // ERROR "too few"
|
2009-09-15 23:42:24 +04:00
|
|
|
_, _, _ = s1, s3, s2;
|
2009-08-15 02:13:32 +04:00
|
|
|
}
|