Plural variable naming and slice instead of array
This commit is contained in:
parent
e424d9b6f8
commit
72783f6458
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue