github.com/zach-klippenstein/go@v0.0.0-20150108044943-fcfbeb3adf58/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  // Blanks not in doc output:
    48  
    49  // S has a padding field.
    50  type S struct {
    51  	H uint32
    52  	_ uint8
    53  	A uint8
    54  }
    55  
    56  func _() {}
    57  
    58  type _ T
    59  
    60  var _ = T(55)