github.com/dimfeld/httppath v0.0.0-20170720192232-ee938bf73598
Go module source archive layoutMarkdown references a remote image
SHA-256ff59ff07643eccf8a166cc9693fbd18c42869e0bfcc0a9c979435847a7ae4fb1
MaleculeH₃(Cm₂DbMg)Md(Pa)
Evidence
1# HttpPath [](https://travis-ci.org/dimfeld/httppath) [](ht …
1:207… doc.org/github.com/dimfeld/httppath)
2
3Utilities for HTTP Path manipulation.
4
5Currently, this just contains the CleanPath function, renamed to Clean, from [Julien Schmidt's httprouter](https://github.com/julienschmidt/httprouter).
1:20… ulien Schmidt. All rights reserved.
2// Based on the path package, Copyright 2009 The Go Authors.
3// Use of this source code is governed by a BSD-style license that can be found
4// in the LICENSE file.
5
6package httppath
7
8// Clean is the URL version of path.Clean, it returns a canonical URL path
9// for p, eliminating . and .. elements.
10//
11// The following rules are applied iteratively until no further processing can
12// be done:
13// 1. Replace multiple slashes with a single slash.
14// 2. Eliminate each . path name element (the current directory).
15// 3. Elimina …
⋯4 lines
25
26 n := len(p)
27 var buf []byte
28
29 // Invariants:
30 // reading from path; r is index of next byte to process.
31 // writing to buf; w is index of next by …
34:4… := 1
35 w := 1
36
37 if p[0] != '/' {
38 r = 0
39 buf = make([]byte, n+1)
40 buf[0] = '/'
41 }
⋯4 lines
No evidence locations were recorded for this file. Raw result