Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
142008c3
Commit
142008c3
authored
May 13, 2011
by
Robert Hencke
Committed by
Rob Pike
May 13, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strconv: document and test True and False for Atob
R=golang-dev CC=golang-dev
https://golang.org/cl/4535057
parent
a005617c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
atob.go
src/pkg/strconv/atob.go
+2
-2
atob_test.go
src/pkg/strconv/atob_test.go
+2
-0
No files found.
src/pkg/strconv/atob.go
View file @
142008c3
...
...
@@ -7,8 +7,8 @@ package strconv
import
"os"
// Atob returns the boolean value represented by the string.
// It accepts 1, t, T, TRUE, true,
0, f, F, FALSE, false. Any other value returns
// an error.
// It accepts 1, t, T, TRUE, true,
True, 0, f, F, FALSE, false, False.
//
Any other value returns
an error.
func
Atob
(
str
string
)
(
value
bool
,
err
os
.
Error
)
{
switch
str
{
case
"1"
,
"t"
,
"T"
,
"true"
,
"TRUE"
,
"True"
:
...
...
src/pkg/strconv/atob_test.go
View file @
142008c3
...
...
@@ -24,11 +24,13 @@ var atobtests = []atobTest{
{
"F"
,
false
,
nil
},
{
"FALSE"
,
false
,
nil
},
{
"false"
,
false
,
nil
},
{
"False"
,
false
,
nil
},
{
"1"
,
true
,
nil
},
{
"t"
,
true
,
nil
},
{
"T"
,
true
,
nil
},
{
"TRUE"
,
true
,
nil
},
{
"true"
,
true
,
nil
},
{
"True"
,
true
,
nil
},
}
func
TestAtob
(
t
*
testing
.
T
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment