Godeps updates (#656)
* Inconsistencies between godeps and vendor * Update spf13/cobra to 9c28e4b Previous HEAD position was f62e98d... Merge pull request #300 from cshung/master HEAD is now at 9c28e4b... Merge pull request #339 from bogem/fixes * Update spf13/pflag to c7e63cf Previous HEAD position was 1560c10... Bump Go versions in Travis config HEAD is now at c7e63cf... Merge pull request #93 from bogem/flagStrings * Update spf13/viper to ed0a967 Previous HEAD position was 382f87b... Remove expensive TRACE logging HEAD is now at ed0a967... Fix retrieval of pflag stringSlice (#240) * Update docker/machine to 91e368pull/658/head
parent
5c5bdc21dc
commit
6f8c520d2f
|
@ -49,11 +49,6 @@
|
|||
"Comment": "v7.0.6-4-g2492d97",
|
||||
"Rev": "2492d97b402e00797833c03ac5fa1c572c7bb29a"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/BurntSushi/toml",
|
||||
"Comment": "v0.2.0-9-gf0aeabc",
|
||||
"Rev": "f0aeabca5a127c4078abb8c8d64298b147264b55"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/ClusterHQ/flocker-go",
|
||||
"Rev": "1c0a791b33bdc01d062b376612aa04e27eed7eb3"
|
||||
|
@ -815,158 +810,158 @@
|
|||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/commands/mcndirs",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/drivers/errdriver",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/drivers/hyperv",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/drivers/none",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/drivers/virtualbox",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/drivers/vmwarefusion",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine/auth",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine/cert",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine/check",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine/drivers",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine/drivers/plugin",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine/drivers/plugin/localbinary",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine/drivers/rpc",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine/engine",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine/host",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine/log",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine/mcndockerclient",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine/mcnerror",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine/mcnflag",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine/mcnutils",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine/persist",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine/provision",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine/provision/pkgaction",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine/provision/serviceaction",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine/shell",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine/ssh",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine/state",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine/swarm",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/libmachine/version",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/machine/version",
|
||||
"Comment": "v0.7.0-62-g6002b41",
|
||||
"Rev": "6002b411ce820eaf03ac972a7fb354bb56f7aa95"
|
||||
"Comment": "docs-v0.8.2-2016-09-26-11-g91e368e",
|
||||
"Rev": "91e368eb7422665278b1d5665139ee0f9980b588"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/docker/spdystream",
|
||||
|
@ -1423,6 +1418,10 @@
|
|||
"ImportPath": "github.com/juju/ratelimit",
|
||||
"Rev": "77ed1c8a01217656d2080ad51981f6e99adaa177"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/kr/fs",
|
||||
"Rev": "2788f0dbd16903de03cb8186e5c7d97b69ad387b"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/kr/pty",
|
||||
"Comment": "release.r56-29-gf7ee69f",
|
||||
|
@ -1584,6 +1583,15 @@
|
|||
"ImportPath": "github.com/pborman/uuid",
|
||||
"Rev": "ca53cad383cad2479bbba7f7a1a05797ec1386e4"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/pelletier/go-buffruneio",
|
||||
"Rev": "df1e16fde7fc330a0ca68167c23bf7ed6ac31d6d"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/pelletier/go-toml",
|
||||
"Comment": "v0.3.5-16-g45932ad",
|
||||
"Rev": "45932ad32dfdd20826f5671da37a5f3ce9f26a8d"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/pkg/browser",
|
||||
"Rev": "9302be274faad99162b9d48ec97b24306872ebb0"
|
||||
|
@ -1593,6 +1601,10 @@
|
|||
"Comment": "v0.7.1",
|
||||
"Rev": "17b591df37844cde689f4d5813e5cea0927d8dd2"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/pkg/sftp",
|
||||
"Rev": "4d0e916071f68db74f8a73926335f809396d6b42"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/prometheus/client_golang/prometheus",
|
||||
"Comment": "0.7.0-52-ge51041b",
|
||||
|
@ -1836,17 +1848,29 @@
|
|||
"Comment": "2.5.3a-41-g00ade30",
|
||||
"Rev": "00ade3024f047d26130abf161900e0adb72a06f1"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/spf13/afero",
|
||||
"Rev": "52e4a6cfac46163658bd4f123c49b6ee7dc75f78"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/spf13/afero/mem",
|
||||
"Rev": "52e4a6cfac46163658bd4f123c49b6ee7dc75f78"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/spf13/afero/sftp",
|
||||
"Rev": "52e4a6cfac46163658bd4f123c49b6ee7dc75f78"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/spf13/cast",
|
||||
"Rev": "27b586b42e29bec072fe7379259cc719e1289da6"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/spf13/cobra",
|
||||
"Rev": "f62e98d28ab7ad31d707ba837a966378465c7b57"
|
||||
"Rev": "9c28e4bbd74e5c3ed7aacbc552b2cab7cfdfe744"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/spf13/cobra/doc",
|
||||
"Rev": "f62e98d28ab7ad31d707ba837a966378465c7b57"
|
||||
"Rev": "9c28e4bbd74e5c3ed7aacbc552b2cab7cfdfe744"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/spf13/jwalterweatherman",
|
||||
|
@ -1854,11 +1878,11 @@
|
|||
},
|
||||
{
|
||||
"ImportPath": "github.com/spf13/pflag",
|
||||
"Rev": "1560c1005499d61b80f865c04d39ca7505bf7f0b"
|
||||
"Rev": "c7e63cf4530bcd3ba943729cee0efeff2ebea63f"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/spf13/viper",
|
||||
"Rev": "c1ccc378a054ea8d4e38d8c67f6938d4760b53dd"
|
||||
"Rev": "ed0a9674c6ef3646e218d8bb70708d250e94354b"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/syndtr/gocapability/capability",
|
||||
|
|
|
@ -15,9 +15,8 @@ func statvfsFromStatfst(stat *syscall.Statfs_t) (*StatVFS, error) {
|
|||
Bavail: stat.Bavail,
|
||||
Files: stat.Files,
|
||||
Ffree: stat.Ffree,
|
||||
Favail: stat.Ffree, // not sure how to calculate Favail
|
||||
Fsid: uint64(uint64(stat.Fsid.X__val[1])<<32 | uint64(stat.Fsid.X__val[0])), // endianness?
|
||||
Flag: uint64(stat.Flags), // assuming POSIX?
|
||||
Favail: stat.Ffree, // not sure how to calculate Favail
|
||||
Flag: uint64(stat.Flags), // assuming POSIX?
|
||||
Namemax: uint64(stat.Namelen),
|
||||
}, nil
|
||||
}
|
||||
|
|
|
@ -24,10 +24,6 @@ var (
|
|||
// complete the transformation.
|
||||
ErrShortSrc = errors.New("transform: short source buffer")
|
||||
|
||||
// ErrEndOfSpan means that the input and output (the transformed input)
|
||||
// are not identical.
|
||||
ErrEndOfSpan = errors.New("transform: input and output are not identical")
|
||||
|
||||
// errInconsistentByteCount means that Transform returned success (nil
|
||||
// error) but also returned nSrc inconsistent with the src argument.
|
||||
errInconsistentByteCount = errors.New("transform: inconsistent byte count returned")
|
||||
|
@ -64,41 +60,6 @@ type Transformer interface {
|
|||
Reset()
|
||||
}
|
||||
|
||||
// SpanningTransformer extends the Transformer interface with a Span method
|
||||
// that determines how much of the input already conforms to the Transformer.
|
||||
type SpanningTransformer interface {
|
||||
Transformer
|
||||
|
||||
// Span returns a position in src such that transforming src[:n] results in
|
||||
// identical output src[:n] for these bytes. It does not necessarily return
|
||||
// the largest such n. The atEOF argument tells whether src represents the
|
||||
// last bytes of the input.
|
||||
//
|
||||
// Callers should always account for the n bytes consumed before
|
||||
// considering the error err.
|
||||
//
|
||||
// A nil error means that all input bytes are known to be identical to the
|
||||
// output produced by the Transformer. A nil error can be be returned
|
||||
// regardless of whether atEOF is true. If err is nil, then then n must
|
||||
// equal len(src); the converse is not necessarily true.
|
||||
//
|
||||
// ErrEndOfSpan means that the Transformer output may differ from the
|
||||
// input after n bytes. Note that n may be len(src), meaning that the output
|
||||
// would contain additional bytes after otherwise identical output.
|
||||
// ErrShortSrc means that src had insufficient data to determine whether the
|
||||
// remaining bytes would change. Other than the error conditions listed
|
||||
// here, implementations are free to report other errors that arise.
|
||||
//
|
||||
// Calling Span can modify the Transformer state as a side effect. In
|
||||
// effect, it does the transformation just as calling Transform would, only
|
||||
// without copying to a destination buffer and only up to a point it can
|
||||
// determine the input and output bytes are the same. This is obviously more
|
||||
// limited than calling Transform, but can be more efficient in terms of
|
||||
// copying and allocating buffers. Calls to Span and Transform may be
|
||||
// interleaved.
|
||||
Span(src []byte, atEOF bool) (n int, err error)
|
||||
}
|
||||
|
||||
// NopResetter can be embedded by implementations of Transformer to add a nop
|
||||
// Reset method.
|
||||
type NopResetter struct{}
|
||||
|
@ -317,10 +278,6 @@ func (nop) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) {
|
|||
return n, n, err
|
||||
}
|
||||
|
||||
func (nop) Span(src []byte, atEOF bool) (n int, err error) {
|
||||
return len(src), nil
|
||||
}
|
||||
|
||||
type discard struct{ NopResetter }
|
||||
|
||||
func (discard) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) {
|
||||
|
@ -332,8 +289,8 @@ var (
|
|||
// by consuming all bytes and writing nothing.
|
||||
Discard Transformer = discard{}
|
||||
|
||||
// Nop is a SpanningTransformer that copies src to dst.
|
||||
Nop SpanningTransformer = nop{}
|
||||
// Nop is a Transformer that copies src to dst.
|
||||
Nop Transformer = nop{}
|
||||
)
|
||||
|
||||
// chain is a sequence of links. A chain with N Transformers has N+1 links and
|
||||
|
@ -401,8 +358,6 @@ func (c *chain) Reset() {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: make chain use Span (is going to be fun to implement!)
|
||||
|
||||
// Transform applies the transformers of c in sequence.
|
||||
func (c *chain) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) {
|
||||
// Set up src and dst in the chain.
|
||||
|
@ -493,7 +448,8 @@ func (c *chain) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err erro
|
|||
return dstL.n, srcL.p, err
|
||||
}
|
||||
|
||||
// Deprecated: use runes.Remove instead.
|
||||
// RemoveFunc returns a Transformer that removes from the input all runes r for
|
||||
// which f(r) is true. Illegal bytes in the input are replaced by RuneError.
|
||||
func RemoveFunc(f func(r rune) bool) Transformer {
|
||||
return removeF(f)
|
||||
}
|
||||
|
|
|
@ -8,11 +8,7 @@
|
|||
// Package norm contains types and functions for normalizing Unicode strings.
|
||||
package norm
|
||||
|
||||
import (
|
||||
"unicode/utf8"
|
||||
|
||||
"golang.org/x/text/transform"
|
||||
)
|
||||
import "unicode/utf8"
|
||||
|
||||
// A Form denotes a canonical representation of Unicode code points.
|
||||
// The Unicode-defined normalization and equivalence forms are:
|
||||
|
@ -267,34 +263,6 @@ func (f Form) QuickSpan(b []byte) int {
|
|||
return n
|
||||
}
|
||||
|
||||
// Span implements transform.SpanningTransformer. It returns a boundary n such
|
||||
// that b[0:n] == f(b[0:n]). It is not guaranteed to return the largest such n.
|
||||
func (f Form) Span(b []byte, atEOF bool) (n int, err error) {
|
||||
n, ok := formTable[f].quickSpan(inputBytes(b), 0, len(b), atEOF)
|
||||
if n < len(b) {
|
||||
if !ok {
|
||||
err = transform.ErrEndOfSpan
|
||||
} else {
|
||||
err = transform.ErrShortSrc
|
||||
}
|
||||
}
|
||||
return n, err
|
||||
}
|
||||
|
||||
// SpanString returns a boundary n such that s[0:n] == f(s[0:n]).
|
||||
// It is not guaranteed to return the largest such n.
|
||||
func (f Form) SpanString(s string, atEOF bool) (n int, err error) {
|
||||
n, ok := formTable[f].quickSpan(inputString(s), 0, len(s), atEOF)
|
||||
if n < len(s) {
|
||||
if !ok {
|
||||
err = transform.ErrEndOfSpan
|
||||
} else {
|
||||
err = transform.ErrShortSrc
|
||||
}
|
||||
}
|
||||
return n, err
|
||||
}
|
||||
|
||||
// quickSpan returns a boundary n such that src[0:n] == f(src[0:n]) and
|
||||
// whether any non-normalized parts were found. If atEOF is false, n will
|
||||
// not point past the last segment if this segment might be become
|
||||
|
@ -353,7 +321,7 @@ func (f *formInfo) quickSpan(src input, i, end int, atEOF bool) (n int, ok bool)
|
|||
return lastSegStart, false
|
||||
}
|
||||
|
||||
// QuickSpanString returns a boundary n such that s[0:n] == f(s[0:n]).
|
||||
// QuickSpanString returns a boundary n such that b[0:n] == f(s[0:n]).
|
||||
// It is not guaranteed to return the largest such n.
|
||||
func (f Form) QuickSpanString(s string) int {
|
||||
n, _ := formTable[f].quickSpan(inputString(s), 0, len(s), true)
|
||||
|
|
Loading…
Reference in New Issue