Commit 78911ae4 authored by Matt Butcher's avatar Matt Butcher

fix(manager): add documentation to pos function

parent f2e5cdb9
...@@ -278,6 +278,13 @@ func putDeploymentHandlerFunc(w http.ResponseWriter, r *http.Request) { ...@@ -278,6 +278,13 @@ func putDeploymentHandlerFunc(w http.ResponseWriter, r *http.Request) {
} }
} }
// pos gets a path item by position.
//
// For example. the path "/foo/bar" has three positions: "" at 0, "foo" at
// 1, and "bar" at 2.
//
// For verb/path combos, position 0 will be the verb: "GET /foo/bar" will have
// "GET " at position 0.
func pos(w http.ResponseWriter, r *http.Request, i int) (string, error) { func pos(w http.ResponseWriter, r *http.Request, i int) (string, error) {
parts := strings.Split(r.URL.Path, "/") parts := strings.Split(r.URL.Path, "/")
if len(parts) < i-1 { if len(parts) < i-1 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment