Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
830813f0
Commit
830813f0
authored
Nov 08, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
assorted cleanup
R=r, iant CC=go-dev
http://go/go-review/1025024
parent
97a55a74
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
56 additions
and
54 deletions
+56
-54
doc/contribute.html
doc/contribute.html
+27
-9
doc/go_mem.html
doc/go_mem.html
+6
-3
lib/codereview/codereview.py
lib/codereview/codereview.py
+9
-1
src/cmd/gc/print.c
src/cmd/gc/print.c
+1
-1
src/pkg/bufio/bufio.go
src/pkg/bufio/bufio.go
+0
-6
src/pkg/compress/flate/inflate.go
src/pkg/compress/flate/inflate.go
+0
-1
src/pkg/crypto/hmac/hmac_test.go
src/pkg/crypto/hmac/hmac_test.go
+0
-2
src/pkg/go/doc/comment.go
src/pkg/go/doc/comment.go
+8
-22
src/pkg/go/parser/interface.go
src/pkg/go/parser/interface.go
+4
-8
src/pkg/os/os_test.go
src/pkg/os/os_test.go
+1
-1
No files found.
doc/contribute.html
View file @
830813f0
<!-- Contributing to the Go project -->
<!-- Contributing to the Go project -->
<!-- TODO(rsc):
Mention community resources like IRC, mailing lists,
change list email groups, etc.
-->
<h2>
Introduction
</h2>
<h2>
Introduction
</h2>
<p>
<p>
...
@@ -26,6 +21,29 @@ enables discussions about design before much code
...
@@ -26,6 +21,29 @@ enables discussions about design before much code
has been written.
has been written.
</p>
</p>
<h2>
Community resources
</h2>
<p>
For real-time help, there may be users or developers on the
<code>
#go-nuts
</code>
on the
<a
href=
"http://freenode.net/"
>
Freenode
</a>
IRC server.
</p>
<p>
The official mailing list for discussion of the Go language is
<a
href=
"http://groups.google.com/group/golang-nuts"
>
Go Nuts
</a>
.
</p>
<p>
Bugs can be reported using the
<a
href=
"http://code.google.com/p/go/issues/list"
>
Go issue tracker
</a>
.
</p>
<p>
For those who wish to keep up with development,
there is another mailing list,
<a
href=
"http://groups.google.com/group/golang-checkins"
>
golang-checkins
</a>
,
that receives a message summarizing each checkin to the Go repository.
</p>
<h2>
Creating a new package
</h2>
<h2>
Creating a new package
</h2>
<p>
<p>
...
@@ -244,7 +262,7 @@ The Mercurial configuration file format does not allow environment variable subs
...
@@ -244,7 +262,7 @@ The Mercurial configuration file format does not allow environment variable subs
<p>
<p>
The code review server uses a Google Account to authenticate.
The code review server uses a Google Account to authenticate.
(If you can use the account to
(If you can use the account to
<a
href=
"https://www.google.com/accounts/Login?hl=en&continue=http://www.google.com/"
>
sign in at google.com
</a>
,
<a
href=
"https://www.google.com/accounts/Login?hl=en&
amp;
continue=http://www.google.com/"
>
sign in at google.com
</a>
,
you can use it to sign in to the code review server.)
you can use it to sign in to the code review server.)
</p>
</p>
...
@@ -425,7 +443,7 @@ warning: conflicts during merge.
...
@@ -425,7 +443,7 @@ warning: conflicts during merge.
<i>
merging src/pkg/flag/flag_test.go failed!
</i>
<i>
merging src/pkg/flag/flag_test.go failed!
</i>
1 file updated, 0 files merged, 0 files removed, 1 file unresolved
1 file updated, 0 files merged, 0 files removed, 1 file unresolved
use 'hg resolve' to retry unresolved file merges
use 'hg resolve' to retry unresolved file merges
$
$
</pre>
</pre>
<p>
<p>
...
@@ -468,8 +486,8 @@ that you have corrected the file.
...
@@ -468,8 +486,8 @@ that you have corrected the file.
</p>
</p>
<p>
<p>
If you had been editing the file, say for debugging, but do not
If you had been editing the file, say for debugging, but do not
care to preserve your changes, you can run
care to preserve your changes, you can run
<code>
hg revert flag_test.go
</code>
to abandon your
<code>
hg revert flag_test.go
</code>
to abandon your
changes.
changes.
</p>
</p>
...
...
doc/go_mem.html
View file @
830813f0
...
@@ -233,7 +233,7 @@ The <code>sync</code> package implements two lock data types,
...
@@ -233,7 +233,7 @@ The <code>sync</code> package implements two lock data types,
</p>
</p>
<p
class=
"rule"
>
<p
class=
"rule"
>
For any
<code>
sync.Mutex
</code>
variable
<code>
l
</code>
and
<i>
n
</i>
<
<i>
m
</i>
,
For any
<code>
sync.Mutex
</code>
or
<code>
sync.RWMutex
</code>
variable
<code>
l
</code>
and
<i>
n
</i>
<
<i>
m
</i>
,
the
<i>
n
</i>
'th call to
<code>
l.Unlock()
</code>
happens before the
<i>
m
</i>
'th call to
<code>
l.Lock()
</code>
returns.
the
<i>
n
</i>
'th call to
<code>
l.Unlock()
</code>
happens before the
<i>
m
</i>
'th call to
<code>
l.Lock()
</code>
returns.
</p>
</p>
...
@@ -265,8 +265,11 @@ before the second call to <code>l.Lock()</code> (in <code>main</code>) returns,
...
@@ -265,8 +265,11 @@ before the second call to <code>l.Lock()</code> (in <code>main</code>) returns,
which happens before the
<code>
print
</code>
.
which happens before the
<code>
print
</code>
.
</p>
</p>
<p>
<p
class=
"rule"
>
TODO(rsc):
<code>
sync.RWMutex
</code>
.
For any call to
<code>
l.RLock
</code>
on a
<code>
sync.RWMutex
</code>
variable
<code>
l
</code>
,
there is an
<i>
n
</i>
such that the
<code>
l.RLock
</code>
happens (returns) after the
<i>
n
</i>
'th call to
<code>
l.Unlock
</code>
and the matching
<code>
l.RUnlock
</code>
happens
before the
<i>
n
</i>
+1'th call to
<code>
l.Lock
</code>
.
</p>
</p>
<h3>
Once
</h3>
<h3>
Once
</h3>
...
...
lib/codereview/codereview.py
View file @
830813f0
...
@@ -1078,7 +1078,15 @@ def sync(ui, repo, **opts):
...
@@ -1078,7 +1078,15 @@ def sync(ui, repo, **opts):
sync_changes
(
ui
,
repo
)
sync_changes
(
ui
,
repo
)
def
sync_note
(
msg
):
def
sync_note
(
msg
):
if
msg
==
'resolving manifests
\
n
'
or
msg
==
'searching for changes
\
n
'
:
# we run sync (pull -u) in verbose mode to get the
# list of files being updated, but that drags along
# a bunch of messages we don't care about.
# omit them.
if
msg
==
'resolving manifests
\
n
'
:
return
if
msg
==
'searching for changes
\
n
'
:
return
if
msg
==
"couldn't find merge tool hgmerge
\
n
"
:
return
return
sys
.
stdout
.
write
(
msg
)
sys
.
stdout
.
write
(
msg
)
...
...
src/cmd/gc/print.c
View file @
830813f0
...
@@ -293,7 +293,7 @@ exprfmt(Fmt *f, Node *n, int prec)
...
@@ -293,7 +293,7 @@ exprfmt(Fmt *f, Node *n, int prec)
case
OCONVIFACE
:
case
OCONVIFACE
:
case
OARRAYBYTESTR
:
case
OARRAYBYTESTR
:
case
ORUNESTR
:
case
ORUNESTR
:
if
(
n
->
type
->
sym
==
S
)
if
(
n
->
type
==
T
||
n
->
type
->
sym
==
S
)
fmtprint
(
f
,
"(%T)("
,
n
->
type
);
fmtprint
(
f
,
"(%T)("
,
n
->
type
);
else
else
fmtprint
(
f
,
"%T("
,
n
->
type
);
fmtprint
(
f
,
"%T("
,
n
->
type
);
...
...
src/pkg/bufio/bufio.go
View file @
830813f0
...
@@ -15,12 +15,6 @@ import (
...
@@ -15,12 +15,6 @@ import (
)
)
// TODO:
// - maybe define an interface
// - Reader: ReadRune, UnreadRune ?
// could make ReadRune generic if we dropped UnreadRune
// - buffered output
const
(
const
(
defaultBufSize
=
4096
;
defaultBufSize
=
4096
;
)
)
...
...
src/pkg/compress/flate/inflate.go
View file @
830813f0
...
@@ -197,7 +197,6 @@ type Reader interface {
...
@@ -197,7 +197,6 @@ type Reader interface {
}
}
// Inflate state.
// Inflate state.
// TODO(rsc): Expose this or not?
type
inflater
struct
{
type
inflater
struct
{
// Input/output sources.
// Input/output sources.
r
Reader
;
r
Reader
;
...
...
src/pkg/crypto/hmac/hmac_test.go
View file @
830813f0
...
@@ -4,8 +4,6 @@
...
@@ -4,8 +4,6 @@
package
hmac
package
hmac
// TODO(rsc): better test
import
(
import
(
"hash"
;
"hash"
;
"fmt"
;
"fmt"
;
...
...
src/pkg/go/doc/comment.go
View file @
830813f0
...
@@ -133,7 +133,7 @@ func commentEscape(w io.Writer, s []byte) {
...
@@ -133,7 +133,7 @@ func commentEscape(w io.Writer, s []byte) {
last
:=
0
;
last
:=
0
;
for
i
:=
0
;
i
<
len
(
s
)
-
1
;
i
++
{
for
i
:=
0
;
i
<
len
(
s
)
-
1
;
i
++
{
if
s
[
i
]
==
s
[
i
+
1
]
&&
(
s
[
i
]
==
'`'
||
s
[
i
]
==
'\'
'
)
{
if
s
[
i
]
==
s
[
i
+
1
]
&&
(
s
[
i
]
==
'`'
||
s
[
i
]
==
'\'
'
)
{
template
.
H
tml
Escape
(
w
,
s
[
last
:
i
]);
template
.
H
TML
Escape
(
w
,
s
[
last
:
i
]);
last
=
i
+
2
;
last
=
i
+
2
;
switch
s
[
i
]
{
switch
s
[
i
]
{
case
'`'
:
case
'`'
:
...
@@ -144,7 +144,7 @@ func commentEscape(w io.Writer, s []byte) {
...
@@ -144,7 +144,7 @@ func commentEscape(w io.Writer, s []byte) {
i
++
;
// loop will add one more
i
++
;
// loop will add one more
}
}
}
}
template
.
H
tml
Escape
(
w
,
s
[
last
:
len
(
s
)]);
template
.
H
TML
Escape
(
w
,
s
[
last
:
len
(
s
)]);
}
}
...
@@ -211,10 +211,9 @@ func unindent(block [][]byte) {
...
@@ -211,10 +211,9 @@ func unindent(block [][]byte) {
//
//
// TODO(rsc): I'd like to pass in an array of variable names []string
// TODO(rsc): I'd like to pass in an array of variable names []string
// and then italicize those strings when they appear as words.
// and then italicize those strings when they appear as words.
func
ToH
tml
(
w
io
.
Writer
,
s
[]
byte
)
{
func
ToH
TML
(
w
io
.
Writer
,
s
[]
byte
)
{
inpara
:=
false
;
inpara
:=
false
;
/* TODO(rsc): 6g cant generate code for these
close
:=
func
()
{
close
:=
func
()
{
if
inpara
{
if
inpara
{
w
.
Write
(
html_endp
);
w
.
Write
(
html_endp
);
...
@@ -227,7 +226,6 @@ func ToHtml(w io.Writer, s []byte) {
...
@@ -227,7 +226,6 @@ func ToHtml(w io.Writer, s []byte) {
inpara
=
true
;
inpara
=
true
;
}
}
};
};
*/
lines
:=
split
(
s
);
lines
:=
split
(
s
);
unindent
(
lines
);
unindent
(
lines
);
...
@@ -235,19 +233,13 @@ func ToHtml(w io.Writer, s []byte) {
...
@@ -235,19 +233,13 @@ func ToHtml(w io.Writer, s []byte) {
line
:=
lines
[
i
];
line
:=
lines
[
i
];
if
isBlank
(
line
)
{
if
isBlank
(
line
)
{
// close paragraph
// close paragraph
if
inpara
{
close
();
w
.
Write
(
html_endp
);
inpara
=
false
;
}
i
++
;
i
++
;
continue
;
continue
;
}
}
if
indentLen
(
line
)
>
0
{
if
indentLen
(
line
)
>
0
{
// close paragraph
// close paragraph
if
inpara
{
close
();
w
.
Write
(
html_endp
);
inpara
=
false
;
}
// count indented or blank lines
// count indented or blank lines
j
:=
i
+
1
;
j
:=
i
+
1
;
...
@@ -268,21 +260,15 @@ func ToHtml(w io.Writer, s []byte) {
...
@@ -268,21 +260,15 @@ func ToHtml(w io.Writer, s []byte) {
// just html escaping
// just html escaping
w
.
Write
(
html_pre
);
w
.
Write
(
html_pre
);
for
_
,
line
:=
range
block
{
for
_
,
line
:=
range
block
{
template
.
H
tml
Escape
(
w
,
line
);
template
.
H
TML
Escape
(
w
,
line
);
}
}
w
.
Write
(
html_endpre
);
w
.
Write
(
html_endpre
);
continue
;
continue
;
}
}
// open paragraph
// open paragraph
if
!
inpara
{
open
();
w
.
Write
(
html_p
);
inpara
=
true
;
}
commentEscape
(
w
,
lines
[
i
]);
commentEscape
(
w
,
lines
[
i
]);
i
++
;
i
++
;
}
}
if
inpara
{
close
();
w
.
Write
(
html_endp
);
inpara
=
false
;
}
}
}
src/pkg/go/parser/interface.go
View file @
830813f0
...
@@ -63,8 +63,7 @@ func ParseExpr(filename string, src interface{}) (ast.Expr, os.Error) {
...
@@ -63,8 +63,7 @@ func ParseExpr(filename string, src interface{}) (ast.Expr, os.Error) {
var
p
parser
;
var
p
parser
;
p
.
init
(
filename
,
data
,
0
);
p
.
init
(
filename
,
data
,
0
);
x
:=
p
.
parseExpr
();
// TODO 6g bug - function call order in expr lists
return
p
.
parseExpr
(),
p
.
GetError
(
scanner
.
Sorted
);
return
x
,
p
.
GetError
(
scanner
.
Sorted
);
}
}
...
@@ -81,8 +80,7 @@ func ParseStmtList(filename string, src interface{}) ([]ast.Stmt, os.Error) {
...
@@ -81,8 +80,7 @@ func ParseStmtList(filename string, src interface{}) ([]ast.Stmt, os.Error) {
var
p
parser
;
var
p
parser
;
p
.
init
(
filename
,
data
,
0
);
p
.
init
(
filename
,
data
,
0
);
list
:=
p
.
parseStmtList
();
// TODO 6g bug - function call order in expr lists
return
p
.
parseStmtList
(),
p
.
GetError
(
scanner
.
Sorted
);
return
list
,
p
.
GetError
(
scanner
.
Sorted
);
}
}
...
@@ -99,8 +97,7 @@ func ParseDeclList(filename string, src interface{}) ([]ast.Decl, os.Error) {
...
@@ -99,8 +97,7 @@ func ParseDeclList(filename string, src interface{}) ([]ast.Decl, os.Error) {
var
p
parser
;
var
p
parser
;
p
.
init
(
filename
,
data
,
0
);
p
.
init
(
filename
,
data
,
0
);
list
:=
p
.
parseDeclList
();
// TODO 6g bug - function call order in expr lists
return
p
.
parseDeclList
(),
p
.
GetError
(
scanner
.
Sorted
);
return
list
,
p
.
GetError
(
scanner
.
Sorted
);
}
}
...
@@ -130,8 +127,7 @@ func ParseFile(filename string, src interface{}, mode uint) (*ast.File, os.Error
...
@@ -130,8 +127,7 @@ func ParseFile(filename string, src interface{}, mode uint) (*ast.File, os.Error
var
p
parser
;
var
p
parser
;
p
.
init
(
filename
,
data
,
mode
);
p
.
init
(
filename
,
data
,
mode
);
prog
:=
p
.
parseFile
();
// TODO 6g bug - function call order in expr lists
return
p
.
parseFile
(),
p
.
GetError
(
scanner
.
NoMultiples
);
return
prog
,
p
.
GetError
(
scanner
.
NoMultiples
);
}
}
...
...
src/pkg/os/os_test.go
View file @
830813f0
...
@@ -511,7 +511,7 @@ func TestTime(t *testing.T) {
...
@@ -511,7 +511,7 @@ func TestTime(t *testing.T) {
// A common failure mode on Darwin is to get 0, 0,
// A common failure mode on Darwin is to get 0, 0,
// because it returns the time in registers instead of
// because it returns the time in registers instead of
// filling in the structure passed to the system call.
// filling in the structure passed to the system call.
// T
ODO(rsc): T
oo bad the compiler doesn't know that
// Too bad the compiler doesn't know that
// 365.24*86400 is an integer.
// 365.24*86400 is an integer.
sec
,
nsec
,
err
:=
Time
();
sec
,
nsec
,
err
:=
Time
();
if
sec
<
(
2009
-
1970
)
*
36524
*
864
{
if
sec
<
(
2009
-
1970
)
*
36524
*
864
{
...
...
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