Plural variable naming and slice instead of array

This commit is contained in:
Joel Miles 2019-03-09 22:00:21 -06:00 committed by GitHub
parent e424d9b6f8
commit 72783f6458
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ import (
const defaultScheme = "http"
var supportedProtocol = [2]string{"http", "https", "rdp"}
var supportedProtocols = []string{"http", "https", "rdp"}
func ValidateHostname(hostname string) (string, error) {
if hostname == "" {
@ -117,7 +117,7 @@ func ValidateUrl(originUrl string) (string, error) {
}
func validateScheme(scheme string) error {
for _, protocol := range supportedProtocol {
for _, protocol := range supportedProtocols {
if scheme == protocol {
return nil
}