Init: bootstrap go module

This commit is contained in:
2025-09-04 11:01:05 +08:00
commit 6d7074198f
20 changed files with 658 additions and 0 deletions

26
cmd/root.go Normal file
View File

@@ -0,0 +1,26 @@
package cmd
import (
"strings"
"gitea.konchin.com/ytshih/inp2025/game/cmd/serve"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
var RootCmd = &cobra.Command{
Use: "game",
Short: "Game for Intro. to Network Programming 2025",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
viper.AutomaticEnv()
viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_"))
viper.BindPFlags(cmd.PersistentFlags())
viper.BindPFlags(cmd.Flags())
},
}
func init() {
cobra.EnableTraverseRunHooks = true
RootCmd.AddCommand(serve.RootCmd)
}