gitlab.com/evatix-go/core@v1.3.55/cmd/main/enumTesting.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  	"log"
     6  
     7  	"gitlab.com/evatix-go/core/bytetype"
     8  	"gitlab.com/evatix-go/core/corecomparator"
     9  	"gitlab.com/evatix-go/core/ostype"
    10  )
    11  
    12  func enumTesting() {
    13  	names, _ := corecomparator.Equal.MarshalJSON()
    14  
    15  	fmt.Println(string(names))
    16  
    17  	noteq := corecomparator.NotEqual
    18  
    19  	noteq.UnmarshalJSON([]byte("3"))
    20  
    21  	fmt.Println(noteq.Name())
    22  	fmt.Println(noteq.NumberString())
    23  	fmt.Println(noteq.NumberString())
    24  	fmt.Println(bytetype.BasicEnumImpl.AppendPrependJoinValue(".", 1, 2))
    25  
    26  	linux := ostype.Linux
    27  	anroid := ostype.Android
    28  	marshalledLinux, _ := linux.MarshalJSON()
    29  
    30  	fmt.Println(marshalledLinux)
    31  
    32  	err := anroid.UnmarshalJSON(marshalledLinux)
    33  	if err != nil {
    34  		log.Fatalln(err)
    35  	}
    36  	fmt.Println(anroid)
    37  
    38  	windowsGrp := ostype.WindowsGroup
    39  	windowsBytes, _ := windowsGrp.MarshalJSON()
    40  	unixGrp := ostype.UnixGroup
    41  	unixGrp.UnmarshalJSON(windowsBytes)
    42  	fmt.Print(unixGrp)
    43  }