@@ -95,14 +95,14 @@ func StartServer(wg *sync.WaitGroup) {
95
95
fmt .Println ("call user function [after] to do something..." )
96
96
job0 := "print now datetime"
97
97
cancel0 := schedule .NewJob (job0 , func () {
98
- fmt .Println ("now: " , utils .FormatDate (time .Now (), utils .YYYY_MM_DD_HH_MM_SS_EN ))
98
+ fmt .Println ("now: " , utils .Datetime (). FormatDate (time .Now (), utils .YYYY_MM_DD_HH_MM_SS_EN ))
99
99
}).RunAt (schedule .EveryMinute )
100
100
time .AfterFunc (time .Minute * 3 , cancel0 )
101
101
102
102
job1 := "print hello"
103
103
cancel1 := schedule .NewJob (job1 , func () {
104
104
time .Sleep (time .Second * 10 )
105
- fmt .Println (utils .FormatDate (time .Now (), utils .YYYY_MM_DD_HH_MM_SS_EN ), "hello" )
105
+ fmt .Println (utils .Datetime (). FormatDate (time .Now (), utils .YYYY_MM_DD_HH_MM_SS_EN ), "hello" )
106
106
sail .GetLogger ().Info ("print log info to console" ,
107
107
zap .String ("value" , "go-sail" ),
108
108
zap .Errors ("errors" , []error {nil }))
@@ -141,7 +141,7 @@ func RegisterServicesToNacos(wg *sync.WaitGroup) {
141
141
142
142
nc := nacos .GetNamingClient ()
143
143
var param vo.RegisterInstanceParam
144
- localIp , err := utils .GetLocalIP ()
144
+ localIp , err := utils .IP (). GetLocal ()
145
145
if err == nil {
146
146
param .Ip = localIp
147
147
}
@@ -168,7 +168,7 @@ func RegisterServicesToNacos(wg *sync.WaitGroup) {
168
168
func UnregisterServiceFromNacos () {
169
169
nc := nacos .GetNamingClient ()
170
170
var param vo.DeregisterInstanceParam
171
- localIp , err := utils .GetLocalIP ()
171
+ localIp , err := utils .IP (). GetLocal ()
172
172
if err == nil {
173
173
param .Ip = localIp
174
174
}
0 commit comments