github.com/cnboonhan/delve@v0.0.0-20230908061759-363f2388c2fb/_fixtures/consts.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  	"github.com/go-delve/delve/_fixtures/internal/dir0/pkg"
     6  	"runtime"
     7  )
     8  
     9  type ConstType uint8
    10  
    11  const (
    12  	constZero ConstType = iota
    13  	constOne
    14  	constTwo
    15  	constThree
    16  )
    17  
    18  type BitFieldType uint8
    19  
    20  const (
    21  	bitZero BitFieldType = 1 << iota
    22  	bitOne
    23  	bitTwo
    24  	bitThree
    25  	bitFour
    26  )
    27  
    28  func main() {
    29  	a := constTwo
    30  	b := constThree
    31  	c := bitZero | bitOne
    32  	d := BitFieldType(33)
    33  	e := ConstType(10)
    34  	f := BitFieldType(0)
    35  	runtime.Breakpoint()
    36  	pkg.SomeVar.AnotherMethod(2)
    37  	fmt.Println(a, b, c, d, e, f, pkg.SomeConst)
    38  }