Skip to content
This repository was archived by the owner on Feb 17, 2023. It is now read-only.

Commit 95b0c16

Browse files
committed
Fix function comments based on best practices from Effective Go
Signed-off-by: CodeLingo Bot <[email protected]>
1 parent 97cc6d1 commit 95b0c16

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

browser.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@ func (p *UserAgent) detectBrowser(sections []section) {
134134
}
135135
}
136136

137-
// Returns two strings. The first string is the name of the engine and the
137+
// Engine returns two strings. The first string is the name of the engine and the
138138
// second one is the version of the engine.
139139
func (p *UserAgent) Engine() (string, string) {
140140
return p.browser.Engine, p.browser.EngineVersion
141141
}
142142

143-
// Returns two strings. The first string is the name of the browser and the
143+
// Browser returns two strings. The first string is the name of the browser and the
144144
// second one is the version of the browser.
145145
func (p *UserAgent) Browser() (string, string) {
146146
return p.browser.Name, p.browser.Version

operating_systems.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,17 +282,17 @@ func (p *UserAgent) detectOS(s section) {
282282
}
283283
}
284284

285-
// Returns a string containing the platform..
285+
// Platform returns a string containing the platform..
286286
func (p *UserAgent) Platform() string {
287287
return p.platform
288288
}
289289

290-
// Returns a string containing the name of the Operating System.
290+
// OS returns a string containing the name of the Operating System.
291291
func (p *UserAgent) OS() string {
292292
return p.os
293293
}
294294

295-
// Returns a string containing the localization.
295+
// Localization returns a string containing the localization.
296296
func (p *UserAgent) Localization() string {
297297
return p.localization
298298
}
@@ -325,7 +325,7 @@ func osName(osSplit []string) (name, version string) {
325325
return name, version
326326
}
327327

328-
// Returns combined information for the operating system.
328+
// OSInfo returns combined information for the operating system.
329329
func (p *UserAgent) OSInfo() OSInfo {
330330
// Special case for iPhone weirdness
331331
os := strings.Replace(p.os, "like Mac OS X", "", 1)

user_agent.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,23 +164,23 @@ func (p *UserAgent) Parse(ua string) {
164164
}
165165
}
166166

167-
// Returns the mozilla version (it's how the User Agent string begins:
167+
// Mozilla returns the mozilla version (it's how the User Agent string begins:
168168
// "Mozilla/5.0 ...", unless we're dealing with Opera, of course).
169169
func (p *UserAgent) Mozilla() string {
170170
return p.mozilla
171171
}
172172

173-
// Returns true if it's a bot, false otherwise.
173+
// Bot returns true if it's a bot, false otherwise.
174174
func (p *UserAgent) Bot() bool {
175175
return p.bot
176176
}
177177

178-
// Returns true if it's a mobile device, false otherwise.
178+
// Mobile returns true if it's a mobile device, false otherwise.
179179
func (p *UserAgent) Mobile() bool {
180180
return p.mobile
181181
}
182182

183-
// Returns the original given user agent.
183+
// UA returns the original given user agent.
184184
func (p *UserAgent) UA() string {
185185
return p.ua
186186
}

0 commit comments

Comments
 (0)