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
65061488
Commit
65061488
authored
Feb 08, 2009
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a few small cleanups
R=rsc DELTA=21 (2 added, 2 deleted, 17 changed) OCL=24638 CL=24654
parent
9526f3b8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
19 deletions
+19
-19
doc/go_tutorial.txt
doc/go_tutorial.txt
+1
-1
src/lib/log_test.go
src/lib/log_test.go
+2
-2
src/lib/regexp/regexp.go
src/lib/regexp/regexp.go
+16
-16
No files found.
doc/go_tutorial.txt
View file @
65061488
...
...
@@ -661,7 +661,7 @@ etc., there are also "Fprintf" etc. Unlike in C, "Fprintf"'s first argument is
not a file. Instead, it is a variable of type "io.Write", which is an
interface type defined in the "io" library:
export
type Write interface {
type Write interface {
Write(p []byte) (n int, err *os.Error);
}
...
...
src/lib/log_test.go
View file @
65061488
...
...
@@ -51,6 +51,8 @@ func testLog(t *testing.T, flag int, prefix string, pattern string, useLogf bool
if
err1
!=
nil
{
t
.
Fatal
(
"pipe"
,
err1
);
}
defer
fd0
.
Close
();
defer
fd1
.
Close
();
buf
:=
bufio
.
NewBufRead
(
fd0
);
l
:=
NewLogger
(
fd1
,
nil
,
prefix
,
flag
);
if
useLogf
{
...
...
@@ -70,8 +72,6 @@ func testLog(t *testing.T, flag int, prefix string, pattern string, useLogf bool
if
!
matched
{
t
.
Errorf
(
"log output should match %q is %q"
,
pattern
,
line
);
}
fd0
.
Close
();
fd1
.
Close
();
}
func
TestAllLog
(
t
*
testing
.
T
)
{
...
...
src/lib/regexp/regexp.go
View file @
65061488
...
...
@@ -37,15 +37,15 @@ type instr interface {
}
// Fields and methods common to all instructions
type
_C
ommon
struct
{
type
c
ommon
struct
{
next
instr
;
index
int
;
}
func
(
c
*
_C
ommon
)
Next
()
instr
{
return
c
.
next
}
func
(
c
*
_C
ommon
)
SetNext
(
i
instr
)
{
c
.
next
=
i
}
func
(
c
*
_C
ommon
)
Index
()
int
{
return
c
.
index
}
func
(
c
*
_C
ommon
)
SetIndex
(
i
int
)
{
c
.
index
=
i
}
func
(
c
*
c
ommon
)
Next
()
instr
{
return
c
.
next
}
func
(
c
*
c
ommon
)
SetNext
(
i
instr
)
{
c
.
next
=
i
}
func
(
c
*
c
ommon
)
Index
()
int
{
return
c
.
index
}
func
(
c
*
c
ommon
)
SetIndex
(
i
int
)
{
c
.
index
=
i
}
type
_RE
struct
{
expr
string
;
// the original expression
...
...
@@ -73,7 +73,7 @@ const (
// --- START start of program
type
_Start
struct
{
_C
ommon
c
ommon
}
func
(
start
*
_Start
)
Type
()
int
{
return
_START
}
...
...
@@ -81,7 +81,7 @@ func (start *_Start) Print() { print("start") }
// --- END end of program
type
_End
struct
{
_C
ommon
c
ommon
}
func
(
end
*
_End
)
Type
()
int
{
return
_END
}
...
...
@@ -89,7 +89,7 @@ func (end *_End) Print() { print("end") }
// --- BOT beginning of text
type
_Bot
struct
{
_C
ommon
c
ommon
}
func
(
bot
*
_Bot
)
Type
()
int
{
return
_BOT
}
...
...
@@ -97,7 +97,7 @@ func (bot *_Bot) Print() { print("bot") }
// --- EOT end of text
type
_Eot
struct
{
_C
ommon
c
ommon
}
func
(
eot
*
_Eot
)
Type
()
int
{
return
_EOT
}
...
...
@@ -105,7 +105,7 @@ func (eot *_Eot) Print() { print("eot") }
// --- CHAR a regular character
type
_Char
struct
{
_C
ommon
;
c
ommon
;
char
int
;
}
...
...
@@ -121,7 +121,7 @@ func newChar(char int) *_Char {
// --- CHARCLASS [a-z]
type
_CharClass
struct
{
_C
ommon
;
c
ommon
;
char
int
;
negate
bool
;
// is character class negated? ([^a-z])
// array of int, stored pairwise: [a-z] is (a,z); x is (x,x):
...
...
@@ -171,7 +171,7 @@ func newCharClass() *_CharClass {
// --- ANY any character
type
_Any
struct
{
_C
ommon
c
ommon
}
func
(
any
*
_Any
)
Type
()
int
{
return
_ANY
}
...
...
@@ -179,7 +179,7 @@ func (any *_Any) Print() { print("any") }
// --- BRA parenthesized expression
type
_Bra
struct
{
_C
ommon
;
c
ommon
;
n
int
;
// subexpression number
}
...
...
@@ -188,7 +188,7 @@ func (bra *_Bra) Print() { print("bra", bra.n); }
// --- EBRA end of parenthesized expression
type
_Ebra
struct
{
_C
ommon
;
c
ommon
;
n
int
;
// subexpression number
}
...
...
@@ -197,7 +197,7 @@ func (ebra *_Ebra) Print() { print("ebra ", ebra.n); }
// --- ALT alternation
type
_Alt
struct
{
_C
ommon
;
c
ommon
;
left
instr
;
// other branch
}
...
...
@@ -206,7 +206,7 @@ func (alt *_Alt) Print() { print("alt(", alt.left.Index(), ")"); }
// --- NOP no operation
type
_Nop
struct
{
_C
ommon
c
ommon
}
func
(
nop
*
_Nop
)
Type
()
int
{
return
_NOP
}
...
...
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