Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(636)

Side by Side Diff: src/pkg/asn1/common.go

Issue 4301043: update tree for reflect changes (Closed)
Patch Set: diff -r f692a5e90f6f https://go.googlecode.com/hg/ Created 13 years ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pkg/asn1/asn1_test.go ('k') | src/pkg/asn1/marshal.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package asn1 5 package asn1
6 6
7 import ( 7 import (
8 "reflect" 8 "reflect"
9 "strconv" 9 "strconv"
10 "strings" 10 "strings"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 switch t { 120 switch t {
121 case objectIdentifierType: 121 case objectIdentifierType:
122 return tagOID, false, true 122 return tagOID, false, true
123 case bitStringType: 123 case bitStringType:
124 return tagBitString, false, true 124 return tagBitString, false, true
125 case timeType: 125 case timeType:
126 return tagUTCTime, false, true 126 return tagUTCTime, false, true
127 case enumeratedType: 127 case enumeratedType:
128 return tagEnum, false, true 128 return tagEnum, false, true
129 } 129 }
130 » switch t := t.(type) { 130 » switch t.Kind() {
131 » case *reflect.BoolType: 131 » case reflect.Bool:
132 return tagBoolean, false, true 132 return tagBoolean, false, true
133 » case *reflect.IntType: 133 » case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.In t64:
134 return tagInteger, false, true 134 return tagInteger, false, true
135 » case *reflect.StructType: 135 » case reflect.Struct:
136 return tagSequence, true, true 136 return tagSequence, true, true
137 » case *reflect.SliceType: 137 » case reflect.Slice:
138 if t.Elem().Kind() == reflect.Uint8 { 138 if t.Elem().Kind() == reflect.Uint8 {
139 return tagOctetString, false, true 139 return tagOctetString, false, true
140 } 140 }
141 if strings.HasSuffix(t.Name(), "SET") { 141 if strings.HasSuffix(t.Name(), "SET") {
142 return tagSet, true, true 142 return tagSet, true, true
143 } 143 }
144 return tagSequence, true, true 144 return tagSequence, true, true
145 » case *reflect.StringType: 145 » case reflect.String:
146 return tagPrintableString, false, true 146 return tagPrintableString, false, true
147 } 147 }
148 return 0, false, false 148 return 0, false, false
149 } 149 }
OLDNEW
« no previous file with comments | « src/pkg/asn1/asn1_test.go ('k') | src/pkg/asn1/marshal.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b