blob: a1d680e4a054d1599cbed9b36201b9e7eb01ef81 [file] [log] [blame]
Kevin Burkee11fd002017-07-27 12:51:17 -07001// Copyright 2017 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
5package filepath_test
6
7import (
8 "fmt"
9 "path/filepath"
10)
11
12func ExampleExt() {
13 fmt.Printf("No dots: %q\n", filepath.Ext("index"))
14 fmt.Printf("One dot: %q\n", filepath.Ext("index.js"))
15 fmt.Printf("Two dots: %q\n", filepath.Ext("main.test.js"))
16 // Output:
17 // No dots: ""
18 // One dot: ".js"
19 // Two dots: ".js"
20}