flag를 flagx로 변경

This commit is contained in:
2023-06-21 14:38:26 +09:00
parent ed905a3722
commit 667126c5bc
5 changed files with 12 additions and 20 deletions

View File

@ -1,15 +0,0 @@
package flag
import (
"flag"
"io"
"os"
)
var commandLine = flag.NewFlagSet("maingate", flag.ContinueOnError)
var Devflag = commandLine.Bool("dev", false, "")
func init() {
commandLine.SetOutput(io.Discard)
commandLine.Parse(os.Args[1:])
}

View File

@ -17,9 +17,9 @@ import (
"sync"
"time"
"repositories.action2quare.com/ayo/gocommon/flagx"
"repositories.action2quare.com/ayo/gocommon/logger"
"repositories.action2quare.com/ayo/gocommon/wshandler"
"repositories.action2quare.com/ayo/tavern/core/flag"
"repositories.action2quare.com/ayo/tavern/core/rpc"
"github.com/go-redis/redis/v8"
@ -942,6 +942,8 @@ func (gm *groupInMemory) UpdateGroupDocument(gid groupID, body []byte) error {
return gm.groupDocSync(gid, newbody)
}
var devflag = flagx.Bool("dev", false, "")
func (cfg *groupConfig) prepareInMemory(ctx context.Context, region string, typename string, wsh *wshandler.WebsocketHandler) (group, error) {
// group document
// member document
@ -953,7 +955,7 @@ func (cfg *groupConfig) prepareInMemory(ctx context.Context, region string, type
toHashHex := func(name string) string {
hash := md5.New()
hash.Write([]byte(name))
if *flag.Devflag {
if *devflag {
hn, _ := os.Hostname()
hash.Write([]byte(hn))
}