1 written by hand - just enough to compile rsc.io/sampler, rsc.io/quote
4 module golang.org/x/text
6 {"Version":"v0.0.0-20170915032832-14c0d48ead0c","Name":"v0.0.0-20170915032832-14c0d48ead0c","Short":"14c0d48ead0c","Time":"2017-09-15T03:28:32Z"}
8 module golang.org/x/text
11 -- language/lang.go --
12 // Copyright 2018 The Go Authors. All rights reserved.
13 // Use of this source code is governed by a BSD-style
14 // license that can be found in the LICENSE file.
16 // This is a tiny version of golang.org/x/text.
24 func Make(s string) Tag { return Tag(s) }
26 func (t Tag) String() string { return string(t) }
28 func NewMatcher(tags []Tag) Matcher { return &matcher{tags} }
30 type Matcher interface {
31 Match(...Tag) (Tag, int, int)
38 func (m *matcher) Match(prefs ...Tag) (Tag, int, int) {
39 for _, pref := range prefs {
40 for _, tag := range m.tags {
41 if tag == pref || strings.HasPrefix(string(pref), string(tag+"-")) || strings.HasPrefix(string(tag), string(pref+"-")) {
46 return m.tags[0], 0, 0