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
6739b8d6
Commit
6739b8d6
authored
Jun 04, 2009
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
string([]int) is now implemented
R=rsc DELTA=18 (10 added, 2 deleted, 6 changed) OCL=29909 CL=29909
parent
2f2577a4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
go_spec.html
doc/go_spec.html
+0
-2
string.go
test/ken/string.go
+15
-5
No files found.
doc/go_spec.html
View file @
6739b8d6
...
...
@@ -4388,8 +4388,6 @@ Implementation does not honor the restriction on goto statements and targets (no
cap() does not work on maps or chans.
<br/>
len() does not work on chans.
<br>
string([]int{...}) conversion is not yet implemented.
</font>
</p>
...
...
test/ken/string.go
View file @
6739b8d6
...
...
@@ -88,15 +88,25 @@ main()
z1
[
2
]
=
'c'
;
c
=
string
(
&
z1
);
if
c
!=
"abc"
{
panic
(
"create array "
,
c
);
panic
(
"create
byte
array "
,
c
);
}
/* create string with
byte array pointer
*/
z2
:=
new
([
3
]
byte
)
;
/* create string with
int array
*/
var
z2
[
3
]
int
;
z2
[
0
]
=
'a'
;
z2
[
1
]
=
'
b
'
;
z2
[
1
]
=
'
\u1234
'
;
z2
[
2
]
=
'c'
;
c
=
string
(
z2
);
c
=
string
(
&
z2
);
if
c
!=
"a
\u1234
c"
{
panic
(
"create int array "
,
c
);
}
/* create string with byte array pointer */
z3
:=
new
([
3
]
byte
);
z3
[
0
]
=
'a'
;
z3
[
1
]
=
'b'
;
z3
[
2
]
=
'c'
;
c
=
string
(
z3
);
if
c
!=
"abc"
{
panic
(
"create array pointer "
,
c
);
}
...
...
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