Merge pull request #1112 from CodeLingoBot/rewrite

Fix function comments based on best practices from Effective Go
This commit is contained in:
Hang Yan 2019-03-20 22:29:16 +08:00 committed by GitHub
commit 1ef535a261
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -176,12 +176,12 @@ func formatProviderName(provider string) string {
// EnvSort struct // EnvSort struct
type EnvSort []api.EnvVar type EnvSort []api.EnvVar
// returns the number of elements in the collection. // Len returns the number of elements in the collection.
func (env EnvSort) Len() int { func (env EnvSort) Len() int {
return len(env) return len(env)
} }
// returns whether the element with index i should sort before // Less returns whether the element with index i should sort before
// the element with index j. // the element with index j.
func (env EnvSort) Less(i, j int) bool { func (env EnvSort) Less(i, j int) bool {
return env[i].Name < env[j].Name return env[i].Name < env[j].Name