Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
guozhi.li committed Jan 25, 2024
1 parent 9bfe4fc commit ddb483b
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions internal/keystore/azure/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"math"
"net/http"
"path"
"strings"
"time"

"github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets"
Expand Down Expand Up @@ -234,25 +233,3 @@ func (c *client) GetFirstVersion(ctx context.Context, name string) (string, stat
Message: fmt.Sprintf("There are no versions of %q.", name),
}, nil
}

// endpoint returns an endpoint URL starting with the
// given endpoint followed by the path elements.
//
// For example:
// - endpoint("https://127.0.0.1:7373", "version") => "https://127.0.0.1:7373/version"
// - endpoint("https://127.0.0.1:7373/", "/key/create", "my-key") => "https://127.0.0.1:7373/key/create/my-key"
//
// Any leading or trailing whitespaces are removed from
// the endpoint before it is concatenated with the path
// elements.
//
// The path elements will not be URL-escaped.
func endpoint(endpoint string, elems ...string) string {
endpoint = strings.TrimSpace(endpoint)
endpoint = strings.TrimSuffix(endpoint, "/")

if len(elems) > 0 && !strings.HasPrefix(elems[0], "/") {
endpoint += "/"
}
return endpoint + path.Join(elems...)
}

0 comments on commit ddb483b

Please sign in to comment.