MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / formatAddr

Function formatAddr

gateway/admin/util.go:5–17  ·  view source on GitHub ↗
(address []string)

Source from the content-addressed store, hash-verified

3import "strings"
4
5func formatAddr(address []string) []string {
6 ra := make([]string, 0, len(address))
7 for _, a := range address {
8 if a != "" {
9 if !strings.HasPrefix(a, "http://") && !strings.HasPrefix(a, "https://") {
10 a = "http://" + a
11 }
12
13 ra = append(ra, strings.TrimSuffix(a, "/")+"/")
14 }
15 }
16 return ra
17}

Callers 1

AdminFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected