Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "qb", Short: "A brief description of your application", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your application. For example: Cobra is a CLI library for Go that empowers applications. This application is a tool to generate the needed files to quickly create a Cobra application.`, Run: func(cmd *cobra.Command, args []string) { f, err := os.Open("/Users/jnst/Desktop/castle_lv1.qb") if err != nil { log.Fatal(err) } defer f.Close() b := make([]byte, 1) _, err = f.Read(b) if err != nil { log.Fatal(err) } // Version var major uint8 err = binary.Read(bytes.NewBuffer(b), binary.BigEndian, &major) if err != nil { log.Fatal(err) } _, err = f.Read(b) if err != nil { log.Fatal(err) } var minor uint8 err = binary.Read(bytes.NewBuffer(b), binary.BigEndian, &minor) if err != nil { log.Fatal(err) } _, err = f.Read(b) if err != nil { log.Fatal(err) } var release uint8 err = binary.Read(bytes.NewBuffer(b), binary.BigEndian, &release) if err != nil { log.Fatal(err) } _, err = f.Read(b) if err != nil { log.Fatal(err) } var build uint8 err = binary.Read(bytes.NewBuffer(b), binary.BigEndian, &build) if err != nil { log.Fatal(err) } log.Printf("%d.%d.%d.%d\n", major, minor, release, build) }, }
RootCmd represents the base command when called without any subcommands
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.