Skip to content

Commit

Permalink
fix: flag parse
Browse files Browse the repository at this point in the history
  • Loading branch information
BobWong committed Apr 7, 2020
1 parent 47729d2 commit 88d6afd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 5 additions & 5 deletions service/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ func GetProcName() string {

// 获取外网IP
func GetWANIP() string {
return *flagWANIP
return flagWANIP
}

func GetSvcGroup() string {
return *flagSvcGroup
return flagSvcGroup
}

func GetSvcIndex() int {
return *flagSvcIndex
func GetSvcIndex() string {
return flagSvcIndex
}

func GetDiscoveryAddr() string {
return *flagDiscoveryAddr
return flagDiscoveryAddr
}
3 changes: 1 addition & 2 deletions service/reg.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"github.com/bobwong89757/cellmesh/discovery"
"github.com/bobwong89757/cellnet"
"github.com/bobwong89757/cellnet/util"
"strconv"
)

type peerListener interface {
Expand All @@ -27,7 +26,7 @@ func Register(p cellnet.Peer, options ...interface{}) *discovery.ServiceDesc {
}

sd.SetMeta("SvcGroup", GetSvcGroup())
sd.SetMeta("SvcIndex", strconv.Itoa(GetSvcIndex()))
sd.SetMeta("SvcIndex", GetSvcIndex())

for _, opt := range options {

Expand Down

0 comments on commit 88d6afd

Please sign in to comment.