~john-koepi/ubuntu/trusty/golang/default

« back to all changes in this revision

Viewing changes to src/pkg/encoding/json/encode.go

  • Committer: Package Import Robot
  • Author(s): Ondřej Surý
  • Date: 2012-05-02 15:44:59 UTC
  • mfrom: (14.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20120502154459-wcmy8ao1325ml619
Tags: 2:1.0.1-1
* Imported Upstream version 1.0.1
* Apply godoc patch to display package list correctly (Closes: #669354)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
        "runtime"
18
18
        "sort"
19
19
        "strconv"
 
20
        "strings"
20
21
        "sync"
21
22
        "unicode"
22
23
        "unicode/utf8"
415
416
                return false
416
417
        }
417
418
        for _, c := range s {
418
 
                switch c {
419
 
                case '$', '-', '_', '/', '%':
420
 
                        // Acceptable
 
419
                switch {
 
420
                case strings.ContainsRune("!#$%&()*+-./:<=>?@[]^_{|}~", c):
 
421
                        // Backslash and quote chars are reserved, but
 
422
                        // otherwise any punctuation chars are allowed
 
423
                        // in a tag name.
421
424
                default:
422
425
                        if !unicode.IsLetter(c) && !unicode.IsDigit(c) {
423
426
                                return false