diff options
author | Corey Hulen <corey@hulen.com> | 2017-04-04 11:42:07 -0700 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2017-04-04 14:42:07 -0400 |
commit | 6bf080393d88534aa658ecaff32ae089bd304772 (patch) | |
tree | be25ba4cea3d687d11fe49537b84fae4bf21a484 /vendor/golang.org/x/text/internal/number/pattern.go | |
parent | 32460bf63bc07c69ee5da0bb5640b879facb5538 (diff) | |
download | chat-6bf080393d88534aa658ecaff32ae089bd304772.tar.gz chat-6bf080393d88534aa658ecaff32ae089bd304772.tar.bz2 chat-6bf080393d88534aa658ecaff32ae089bd304772.zip |
Fixing race conditions in the code base (#5966)
* Adding initial race detector
* Remove setting of config twice
* Fixing config file watch and config reload on license save
* Fixing config file watch and config reload on license save
* Fixing build error
* Fixing locking issue
* Fixing makefile
* Fixing race in config
* Fixing race in status unit test
* Adding EE race tests
* Fixing race in cluster info
* Removing code that's isn't needed
* Fixing some more races
* Fixing govet issue
Diffstat (limited to 'vendor/golang.org/x/text/internal/number/pattern.go')
-rw-r--r-- | vendor/golang.org/x/text/internal/number/pattern.go | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/vendor/golang.org/x/text/internal/number/pattern.go b/vendor/golang.org/x/text/internal/number/pattern.go index 2714b7318..018cf02d5 100644 --- a/vendor/golang.org/x/text/internal/number/pattern.go +++ b/vendor/golang.org/x/text/internal/number/pattern.go @@ -31,14 +31,14 @@ import ( // TODO: replace special characters in affixes (-, +, ยค) with control codes. -// Format holds information for formatting numbers. It is designed to hold +// Pattern holds information for formatting numbers. It is designed to hold // information from CLDR number patterns. // // This pattern is precompiled for all patterns for all languages. Even though // the number of patterns is not very large, we want to keep this small. // // This type is only intended for internal use. -type Format struct { +type Pattern struct { // TODO: this struct can be packed a lot better than it is now. Should be // possible to make it 32 bytes. @@ -53,7 +53,7 @@ type Format struct { FormatWidth uint16 GroupingSize [2]uint8 - Flags FormatFlag + Flags PatternFlag // Number of digits. MinIntegerDigits uint8 @@ -65,11 +65,11 @@ type Format struct { MinExponentDigits uint8 } -// A FormatFlag is a bit mask for the flag field of a Format. -type FormatFlag uint8 +// A PatternFlag is a bit mask for the flag field of a Format. +type PatternFlag uint8 const ( - AlwaysSign FormatFlag = 1 << iota + AlwaysSign PatternFlag = 1 << iota AlwaysExpSign AlwaysDecimalSeparator ParenthesisForNegative // Common pattern. Saves space. @@ -85,7 +85,7 @@ const ( ) type parser struct { - *Format + *Pattern leadingSharps int @@ -126,8 +126,8 @@ var ( // ParsePattern extracts formatting information from a CLDR number pattern. // // See http://unicode.org/reports/tr35/tr35-numbers.html#Number_Format_Patterns. -func ParsePattern(s string) (f *Format, err error) { - p := parser{Format: &Format{}} +func ParsePattern(s string) (f *Pattern, err error) { + p := parser{Pattern: &Pattern{}} s = p.parseSubPattern(s) @@ -137,7 +137,7 @@ func ParsePattern(s string) (f *Format, err error) { p.setError(errors.New("format: error parsing first sub pattern")) return nil, p.err } - neg := parser{Format: &Format{}} // just for extracting the affixes. + neg := parser{Pattern: &Pattern{}} // just for extracting the affixes. s = neg.parseSubPattern(s[len(";"):]) p.NegOffset = uint16(len(p.buf)) p.buf = append(p.buf, neg.buf...) @@ -154,7 +154,7 @@ func ParsePattern(s string) (f *Format, err error) { } else { p.Affix = affix } - return p.Format, nil + return p.Pattern, nil } func (p *parser) parseSubPattern(s string) string { @@ -170,7 +170,7 @@ func (p *parser) parseSubPattern(s string) string { return s } -func (p *parser) parsePad(s string, f FormatFlag) (tail string) { +func (p *parser) parsePad(s string, f PatternFlag) (tail string) { if len(s) >= 2 && s[0] == '*' { r, sz := utf8.DecodeRuneInString(s[1:]) if p.PadRune != 0 { |