From 54d3d47daf9190275bbdaf8703b84969a4593451 Mon Sep 17 00:00:00 2001 From: Corey Hulen Date: Fri, 24 Mar 2017 23:31:34 -0700 Subject: PLT-6076 Adding viper libs for config file changes (#5871) * Adding viper libs for config file changes * Removing the old fsnotify lib * updating some missing libs --- vendor/golang.org/x/text/runes/example_test.go | 60 ++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 vendor/golang.org/x/text/runes/example_test.go (limited to 'vendor/golang.org/x/text/runes/example_test.go') diff --git a/vendor/golang.org/x/text/runes/example_test.go b/vendor/golang.org/x/text/runes/example_test.go new file mode 100644 index 000000000..a60bfd9d2 --- /dev/null +++ b/vendor/golang.org/x/text/runes/example_test.go @@ -0,0 +1,60 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package runes_test + +import ( + "fmt" + "unicode" + + "golang.org/x/text/runes" + "golang.org/x/text/transform" + "golang.org/x/text/unicode/norm" + "golang.org/x/text/width" +) + +func ExampleRemove() { + t := transform.Chain(norm.NFD, runes.Remove(runes.In(unicode.Mn)), norm.NFC) + s, _, _ := transform.String(t, "résumé") + fmt.Println(s) + + // Output: + // resume +} + +func ExampleMap() { + replaceHyphens := runes.Map(func(r rune) rune { + if unicode.Is(unicode.Hyphen, r) { + return '|' + } + return r + }) + s, _, _ := transform.String(replaceHyphens, "a-b‐c⸗d﹣e") + fmt.Println(s) + + // Output: + // a|b|c|d|e +} + +func ExampleIn() { + // Convert Latin characters to their canonical form, while keeping other + // width distinctions. + t := runes.If(runes.In(unicode.Latin), width.Fold, nil) + s, _, _ := transform.String(t, "アルアノリウ tech / アルアノリウ tech") + fmt.Println(s) + + // Output: + // アルアノリウ tech / アルアノリウ tech +} + +func ExampleIf() { + // Widen everything but ASCII. + isASCII := func(r rune) bool { return r <= unicode.MaxASCII } + t := runes.If(runes.Predicate(isASCII), nil, width.Widen) + s, _, _ := transform.String(t, "アルアノリウ tech / 中國 / 5₩") + fmt.Println(s) + + // Output: + // アルアノリウ tech / 中國 / 5₩ +} -- cgit v1.2.3-1-g7c22