github.com/flyinox/gosm@v0.0.0-20171117061539-16768cb62077/src/go/doc/testdata/blank.go (about)

     1  // Copyright 2014 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 blank is a go/doc test for the handling of _.
     6  // See issue 5397.
     7  package blank
     8  
     9  import "os"
    10  
    11  type T int
    12  
    13  // T constants counting from a blank constant.
    14  const (
    15  	_ T = iota
    16  	T1
    17  	T2
    18  )
    19  
    20  // T constants counting from unexported constants.
    21  const (
    22  	tweedledee T = iota
    23  	tweedledum
    24  	C1
    25  	C2
    26  	alice
    27  	C3
    28  	redQueen int = iota
    29  	C4
    30  )
    31  
    32  // Constants with an imported type that needs to be propagated.
    33  const (
    34  	zero     os.FileMode = 0
    35  	Default              = 0644
    36  	Useless              = 0312
    37  	WideOpen             = 0777
    38  )
    39  
    40  // Package constants.
    41  const (
    42  	_ int = iota
    43  	I1
    44  	I2
    45  )
    46  
    47  // Unexported constants counting from blank iota.
    48  // See issue 9615.
    49  const (
    50  	_   = iota
    51  	one = iota + 1
    52  )
    53  
    54  // Blanks not in doc output:
    55  
    56  // S has a padding field.
    57  type S struct {
    58  	H uint32
    59  	_ uint8
    60  	A uint8
    61  }
    62  
    63  func _() {}
    64  
    65  type _ T
    66  
    67  var _ = T(55)