...

Source file src/golang.org/x/text/internal/gen/bitfield/gen2_test.go

Documentation: golang.org/x/text/internal/gen/bitfield

     1  // Code generated by golang.org/x/text/internal/gen/bitfield. DO NOT EDIT.
     2  
     3  package bitfield
     4  
     5  type myInt2 uint32
     6  
     7  func (m myInt2) fob() uint16 {
     8  	return uint16((m >> 12) & 0xffff)
     9  }
    10  
    11  func (m myInt2) baz() int8 {
    12  	return int8((m >> 7) & 0x1f)
    13  }
    14  
    15  func (m myInt2) bar() myUint8 {
    16  	return myUint8((m >> 4) & 0x7)
    17  }
    18  
    19  func (m myInt2) Bool() bool {
    20  	const bit = 1 << 3
    21  	return m&bit == bit
    22  }
    23  
    24  func (m myInt2) Baz() int8 {
    25  	return int8((m >> 0) & 0x7)
    26  }
    27  

View as plain text