Skip to content

Commit 94f3992

Browse files
author
Romain Dartigues
committed
code cleanup
1 parent b6ecc41 commit 94f3992

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package clients
22

3-
// config -
3+
// Config -
44
type Config struct {
55
// Cloud foundry api endoint
66
Endpoint string

rawclient.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type RawClientConfig struct {
3131
ApiEndpoint string
3232
}
3333

34-
// Raw http client has uaa client authentication to make raw request with golang native api.
34+
// RawClient Raw http client has uaa client authentication to make raw request with golang native api.
3535
type RawClient struct {
3636
connection cloudcontroller.Connection
3737
apiEndpoint string

requestlogger.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,23 +98,23 @@ func NewRequestLogger() *RequestLogger {
9898
}
9999

100100
func (display *RequestLogger) DisplayBody([]byte) error {
101-
log.Print(fmt.Sprintf("%s\n", RedactedValue))
101+
log.Printf("%s\n", RedactedValue)
102102
return nil
103103
}
104104

105105
func (display *RequestLogger) DisplayDump(dump string) error {
106106
sanitized := display.dumpSanitizer.ReplaceAllString(dump, RedactedValue)
107-
log.Print(fmt.Sprintf("%s\n", sanitized))
107+
log.Printf("%s\n", sanitized)
108108
return nil
109109
}
110110

111111
func (display *RequestLogger) DisplayHeader(name string, value string) error {
112-
log.Print(fmt.Sprintf("%s: %s\n", name, value))
112+
log.Printf("%s: %s\n", name, value)
113113
return nil
114114
}
115115

116116
func (display *RequestLogger) DisplayHost(name string) error {
117-
log.Print(fmt.Sprintf("host: %s\n", name))
117+
log.Printf("host: %s\n", name)
118118
return nil
119119
}
120120

@@ -125,27 +125,27 @@ func (display *RequestLogger) DisplayJSONBody(body []byte) error {
125125

126126
sanitized, err := SanitizeJSON(body)
127127
if err != nil {
128-
log.Print(fmt.Sprintf("%s\n", string(body)))
128+
log.Printf("%s\n", string(body))
129129
return nil
130130
}
131131

132-
log.Print(fmt.Sprintf("%s\n", string(sanitized)))
132+
log.Printf("%s\n", string(sanitized))
133133

134134
return nil
135135
}
136136

137137
func (display *RequestLogger) DisplayMessage(msg string) error {
138-
log.Print(fmt.Sprintf("%s\n", msg))
138+
log.Printf("%s\n", msg)
139139
return nil
140140
}
141141

142142
func (display *RequestLogger) DisplayRequestHeader(method string, uri string, httpProtocol string) error {
143-
log.Print(fmt.Sprintf("%s %s %s\n", method, uri, httpProtocol))
143+
log.Printf("%s %s %s\n", method, uri, httpProtocol)
144144
return nil
145145
}
146146

147147
func (display *RequestLogger) DisplayResponseHeader(httpProtocol string, status string) error {
148-
log.Print(fmt.Sprintf("%s %s\n", httpProtocol, status))
148+
log.Printf("%s %s\n", httpProtocol, status)
149149
return nil
150150
}
151151

session.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,32 +85,32 @@ func NewSession(c Config) (s *Session, err error) {
8585
return s, nil
8686
}
8787

88-
// Give access to api cf v3 (complete and always up to date, thanks to cli v7 team)
88+
// V3 Give access to api cf v3 (complete and always up to date, thanks to cli v7 team)
8989
func (s *Session) V3() *ccv3.Client {
9090
return s.clientV3
9191
}
9292

93-
// Give access to api uaa (incomplete)
93+
// UAA Give access to api uaa (incomplete)
9494
func (s *Session) UAA() *uaa.Client {
9595
return s.clientUAA
9696
}
9797

98-
// Give access to TCP Routing api
98+
// TCPRouter Give access to TCP Routing api
9999
func (s *Session) TCPRouter() *router.Client {
100100
return s.routerClient
101101
}
102102

103-
// Give access to networking policy api
103+
// Networking Give access to networking policy api
104104
func (s *Session) Networking() *cfnetv1.Client {
105105
return s.netClient
106106
}
107107

108-
// Give an http client which pass authorization header to call api(s) directly
108+
// Raw Give an http client which pass authorization header to call api(s) directly
109109
func (s *Session) Raw() *RawClient {
110110
return s.rawClient
111111
}
112112

113-
// Give config store for client which need access token
113+
// ConfigStore Give config store for client which need access token
114114
func (s *Session) ConfigStore() *configv3.Config {
115115
return s.configStore
116116
}

0 commit comments

Comments
 (0)