github.com/tunabay/go-bitarray@v1.3.1/alignment.go (about)

     1  // Copyright (c) 2021 Hirotsuna Mizuno. All rights reserved.
     2  // Use of this source code is governed by the MIT license that can be found in
     3  // the LICENSE file.
     4  
     5  package bitarray
     6  
     7  // Alignment is used in some bitwise operations to specify whether the bits are
     8  // left-aligned or right-aligned. The zero value is AlignLeft.
     9  type Alignment bool
    10  
    11  const (
    12  	AlignLeft  Alignment = false
    13  	AlignRight Alignment = true
    14  )
    15  
    16  // String returns the string representation of Alignment.
    17  func (a Alignment) String() string {
    18  	if a == AlignLeft {
    19  		return "align-left"
    20  	}
    21  	return "align-right"
    22  }