diff options
Diffstat (limited to 'vendor/golang.org/x/text/internal/catmsg/catmsg.go')
-rw-r--r-- | vendor/golang.org/x/text/internal/catmsg/catmsg.go | 43 |
1 files changed, 2 insertions, 41 deletions
diff --git a/vendor/golang.org/x/text/internal/catmsg/catmsg.go b/vendor/golang.org/x/text/internal/catmsg/catmsg.go index c0bf86f..32d6c20 100644 --- a/vendor/golang.org/x/text/internal/catmsg/catmsg.go +++ b/vendor/golang.org/x/text/internal/catmsg/catmsg.go @@ -104,24 +104,20 @@ const ( msgFirst msgRaw msgString - msgAffix - // Leave some arbitrary room for future expansion: 20 should suffice. - numInternal = 20 + numFixed ) const prefix = "golang.org/x/text/internal/catmsg." var ( - // TODO: find a more stable way to link handles to message types. mutex sync.Mutex names = map[string]Handle{ prefix + "Vars": msgVars, prefix + "First": msgFirst, prefix + "Raw": msgRaw, prefix + "String": msgString, - prefix + "Affix": msgAffix, } - handlers = make([]Handler, numInternal) + handlers = make([]Handler, numFixed) ) func init() { @@ -165,20 +161,6 @@ func init() { } return true } - - handlers[msgAffix] = func(d *Decoder) bool { - // TODO: use an alternative method for common cases. - prefix := d.DecodeString() - suffix := d.DecodeString() - if prefix != "" { - d.Render(prefix) - } - ret := d.ExecuteMessage() - if suffix != "" { - d.Render(suffix) - } - return ret - } } var ( @@ -392,24 +374,3 @@ func (s String) Compile(e *Encoder) (err error) { } return err } - -// Affix is a message that adds a prefix and suffix to another message. -// This is mostly used add back whitespace to a translation that was stripped -// before sending it out. -type Affix struct { - Message Message - Prefix string - Suffix string -} - -// Compile implements Message. -func (a Affix) Compile(e *Encoder) (err error) { - // TODO: consider adding a special message type that just adds a single - // return. This is probably common enough to handle the majority of cases. - // Get some stats first, though. - e.EncodeMessageType(msgAffix) - e.EncodeString(a.Prefix) - e.EncodeString(a.Suffix) - e.EncodeMessage(a.Message) - return nil -} |