@@ -20,42 +20,42 @@ func printSummaryInfo(conf config.HttpServerConf, ginEngine *gin.Engine) {
20
20
protocol = "http:"
21
21
messages bytes.Buffer
22
22
localIp , _ = utils .IP ().GetLocal ()
23
- delimiter = [] byte ( strings .Repeat ("=" , 88 ) )
24
- subDelimiter = [] byte ( strings .Repeat ("-" , 88 ) )
23
+ delimiter = strings .Repeat ("=" , 88 )
24
+ subDelimiter = strings .Repeat ("-" , 88 )
25
25
repoLink = "Repository: https://github.com/keepchen/go-sail"
26
26
blank = strings .Repeat (" " , len (delimiter )- len (repoLink )- len (constants .GoSailVersion )- 11 )
27
27
)
28
- messages .Write (delimiter )
28
+ messages .WriteString (delimiter )
29
29
info := fmt .Sprintf ("%s\n " , constants .GoSailLogo )
30
- messages .Write ([] byte ( info ) )
30
+ messages .WriteString ( info )
31
31
versionInfo := fmt .Sprintf ("\n %s%s(version: %s)\n " , repoLink , blank , constants .GoSailVersion )
32
- messages .Write ([] byte ( versionInfo ) )
33
- messages .Write (subDelimiter )
34
- messages .Write ([] byte ( "\n " ) )
32
+ messages .WriteString ( versionInfo )
33
+ messages .WriteString (subDelimiter )
34
+ messages .WriteString ( "\n " )
35
35
sMgs := fmt .Sprintf ("[Server] Listening at: {%s}\n " , conf .Addr )
36
- messages .Write ([] byte ( sMgs ) )
36
+ messages .WriteString ( sMgs )
37
37
if conf .Debug {
38
38
ginEngine .GET ("/go-sail" , func (c * gin.Context ) {
39
39
c .String (http .StatusOK , fmt .Sprintf ("%s\r \n \r \n /** This route only enabled in debug mode **/" , constants .GoSailLogo ))
40
40
})
41
41
msg := fmt .Sprintf (">\t %s//%s%s%s\n " , protocol , localIp , conf .Addr , "/go-sail" )
42
- messages .Write ([] byte ( msg ) )
42
+ messages .WriteString ( msg )
43
43
}
44
44
if conf .Swagger .Enable {
45
45
msg := fmt .Sprintf ("[Swagger] Enabled:\n >\t %s//%s%s%s (Redocly UI)\n >\t %s//%s%s%s (Swagger UI)\n " ,
46
46
protocol , localIp , conf .Addr , "/redoc/docs.html" ,
47
47
protocol , localIp , conf .Addr , "/swagger/index.html" )
48
- messages .Write ([] byte ( msg ) )
48
+ messages .WriteString ( msg )
49
49
}
50
50
if conf .Prometheus .Enable {
51
51
msg := fmt .Sprintf ("[Prometheus] Enabled:\n >\t %s//%s%s%s\n " , protocol , localIp , conf .Prometheus .Addr , conf .Prometheus .AccessPath )
52
- messages .Write ([] byte ( msg ) )
52
+ messages .WriteString ( msg )
53
53
}
54
54
if conf .Debug {
55
55
msg := fmt .Sprintf ("[Pprof] Enabled:\n >\t %s//%s%s%s\n " , protocol , localIp , conf .Addr , "/debug/pprof" )
56
- messages .Write ([] byte ( msg ) )
56
+ messages .WriteString ( msg )
57
57
}
58
- messages .Write (delimiter )
58
+ messages .WriteString (delimiter )
59
59
60
60
fmt .Println (messages .String ())
61
61
}
0 commit comments