OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [go/] [path/] [example_test.go] - Blame information for rev 747

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 747 jeremybenn
// Copyright 2012 The Go Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
4
 
5
package path
6
 
7
/* Commented out until gccgo has example support.
8
 
9
import (
10
        "fmt"
11
        "path"
12
)
13
 
14
// b
15
func ExampleBase() {
16
        fmt.Println(path.Base("/a/b"))
17
}
18
 
19
// Clean("a/c") = "a/c"
20
// Clean("a//c") = "a/c"
21
// Clean("a/c/.") = "a/c"
22
// Clean("a/c/b/..") = "a/c"
23
// Clean("/../a/c") = "/a/c"
24
// Clean("/../a/b/../././/c") = "/a/c"
25
func ExampleClean() {
26
        paths := []string{
27
                "a/c",
28
                "a//c",
29
                "a/c/.",
30
                "a/c/b/..",
31
                "/../a/c",
32
                "/../a/b/../././/c",
33
        }
34
 
35
        for _, p := range paths {
36
                fmt.Printf("Clean(%q) = %q\n", p, path.Clean(p))
37
        }
38
}
39
 
40
// /a/b
41
func ExampleDir() {
42
        fmt.Println(path.Dir("/a/b/c"))
43
}
44
 
45
// .css
46
func ExampleExt() {
47
        fmt.Println(path.Ext("/a/b/c/bar.css"))
48
}
49
 
50
// true
51
func ExampleIsAbs() {
52
        fmt.Println(path.IsAbs("/dev/null"))
53
}
54
 
55
// a/b/c
56
func ExampleJoin() {
57
        fmt.Println(path.Join("a", "b", "c"))
58
}
59
 
60
// static/ myfile.css
61
func ExampleSplit() {
62
        fmt.Println(path.Split("static/myfile.css"))
63
}
64
 
65
*/

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.