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
542099d7
Commit
542099d7
authored
Dec 09, 2009
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
making some more non-gofmt'ed files save for new semicolon rule
R=rsc, r
https://golang.org/cl/171051
parent
5f5dcfbc
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
39 additions
and
42 deletions
+39
-42
test/blank.go
test/blank.go
+1
-1
test/chan/powser1.go
test/chan/powser1.go
+24
-12
test/cmp1.go
test/cmp1.go
+1
-2
test/cmp2.go
test/cmp2.go
+1
-2
test/cmp3.go
test/cmp3.go
+1
-2
test/cmp4.go
test/cmp4.go
+1
-2
test/cmp5.go
test/cmp5.go
+1
-2
test/convert.go
test/convert.go
+1
-3
test/float_lit.go
test/float_lit.go
+3
-6
test/indirect.go
test/indirect.go
+3
-6
test/indirect1.go
test/indirect1.go
+1
-2
test/intcvt.go
test/intcvt.go
+1
-2
No files found.
test/blank.go
View file @
542099d7
...
@@ -31,7 +31,7 @@ const (
...
@@ -31,7 +31,7 @@ const (
var
ints
=
[]
string
{
var
ints
=
[]
string
{
"1"
,
"1"
,
"2"
,
"2"
,
"3"
"3"
,
}
}
func
f
()
(
int
,
int
)
{
func
f
()
(
int
,
int
)
{
...
...
test/chan/powser1.go
View file @
542099d7
...
@@ -20,8 +20,11 @@ type rat struct {
...
@@ -20,8 +20,11 @@ type rat struct {
}
}
func
(
u
rat
)
pr
()
{
func
(
u
rat
)
pr
()
{
if
u
.
den
==
1
{
print
(
u
.
num
)
}
if
u
.
den
==
1
{
else
{
print
(
u
.
num
,
"/"
,
u
.
den
)
}
print
(
u
.
num
)
}
else
{
print
(
u
.
num
,
"/"
,
u
.
den
)
}
print
(
" "
)
print
(
" "
)
}
}
...
@@ -264,8 +267,7 @@ func inv(u rat) rat { // invert a rat
...
@@ -264,8 +267,7 @@ func inv(u rat) rat { // invert a rat
}
}
// print eval in floating point of PS at x=c to n terms
// print eval in floating point of PS at x=c to n terms
func
evaln
(
c
rat
,
U
PS
,
n
int
)
func
evaln
(
c
rat
,
U
PS
,
n
int
)
{
{
xn
:=
float64
(
1
);
xn
:=
float64
(
1
);
x
:=
float64
(
c
.
num
)
/
float64
(
c
.
den
);
x
:=
float64
(
c
.
num
)
/
float64
(
c
.
den
);
val
:=
float64
(
0
);
val
:=
float64
(
0
);
...
@@ -285,8 +287,11 @@ func printn(U PS, n int) {
...
@@ -285,8 +287,11 @@ func printn(U PS, n int) {
done
:=
false
;
done
:=
false
;
for
;
!
done
&&
n
>
0
;
n
--
{
for
;
!
done
&&
n
>
0
;
n
--
{
u
:=
get
(
U
);
u
:=
get
(
U
);
if
end
(
u
)
!=
0
{
done
=
true
}
if
end
(
u
)
!=
0
{
else
{
u
.
pr
()
}
done
=
true
}
else
{
u
.
pr
()
}
}
}
print
((
"
\n
"
));
print
((
"
\n
"
));
}
}
...
@@ -344,8 +349,11 @@ func Cmul(c rat,U PS) PS {
...
@@ -344,8 +349,11 @@ func Cmul(c rat,U PS) PS {
for
!
done
{
for
!
done
{
<-
Z
.
req
;
<-
Z
.
req
;
u
:=
get
(
U
);
u
:=
get
(
U
);
if
end
(
u
)
!=
0
{
done
=
true
}
if
end
(
u
)
!=
0
{
else
{
Z
.
dat
<-
mul
(
c
,
u
)
}
done
=
true
}
else
{
Z
.
dat
<-
mul
(
c
,
u
)
}
}
}
Z
.
dat
<-
finis
;
Z
.
dat
<-
finis
;
}();
}();
...
@@ -461,8 +469,9 @@ func Diff(U PS) PS {
...
@@ -461,8 +469,9 @@ func Diff(U PS) PS {
done
:=
false
;
done
:=
false
;
for
i
:=
1
;
!
done
;
i
++
{
for
i
:=
1
;
!
done
;
i
++
{
u
=
get
(
U
);
u
=
get
(
U
);
if
end
(
u
)
!=
0
{
done
=
true
}
if
end
(
u
)
!=
0
{
else
{
done
=
true
}
else
{
Z
.
dat
<-
mul
(
itor
(
int64
(
i
)),
u
);
Z
.
dat
<-
mul
(
itor
(
int64
(
i
)),
u
);
<-
Z
.
req
;
<-
Z
.
req
;
}
}
...
@@ -556,8 +565,11 @@ func Subst(U, V PS) PS {
...
@@ -556,8 +565,11 @@ func Subst(U, V PS) PS {
u
:=
get
(
U
);
u
:=
get
(
U
);
Z
.
dat
<-
u
;
Z
.
dat
<-
u
;
if
end
(
u
)
==
0
{
if
end
(
u
)
==
0
{
if
end
(
get
(
VV
[
0
]))
!=
0
{
put
(
finis
,
Z
);
}
if
end
(
get
(
VV
[
0
]))
!=
0
{
else
{
copy
(
Mul
(
VV
[
0
],
Subst
(
U
,
VV
[
1
])),
Z
);
}
put
(
finis
,
Z
);
}
else
{
copy
(
Mul
(
VV
[
0
],
Subst
(
U
,
VV
[
1
])),
Z
);
}
}
}
}();
}();
return
Z
;
return
Z
;
...
...
test/cmp1.go
View file @
542099d7
...
@@ -22,8 +22,7 @@ func istrue(b bool) {
...
@@ -22,8 +22,7 @@ func istrue(b bool) {
if
!
b
{
panicln
(
"wanted true, got false"
)
}
// stack will explain where
if
!
b
{
panicln
(
"wanted true, got false"
)
}
// stack will explain where
}
}
func
main
()
func
main
()
{
{
var
a
[]
int
;
var
a
[]
int
;
var
b
map
[
string
]
int
;
var
b
map
[
string
]
int
;
...
...
test/cmp2.go
View file @
542099d7
...
@@ -8,8 +8,7 @@ package main
...
@@ -8,8 +8,7 @@ package main
func
use
(
bool
)
{
}
func
use
(
bool
)
{
}
func
main
()
func
main
()
{
{
var
a
[]
int
;
var
a
[]
int
;
var
ia
interface
{}
=
a
;
var
ia
interface
{}
=
a
;
use
(
ia
==
ia
);
use
(
ia
==
ia
);
...
...
test/cmp3.go
View file @
542099d7
...
@@ -8,8 +8,7 @@ package main
...
@@ -8,8 +8,7 @@ package main
func
use
(
bool
)
{
}
func
use
(
bool
)
{
}
func
main
()
func
main
()
{
{
var
b
[]
int
;
var
b
[]
int
;
var
ib
interface
{}
=
b
;
var
ib
interface
{}
=
b
;
use
(
ib
==
ib
);
use
(
ib
==
ib
);
...
...
test/cmp4.go
View file @
542099d7
...
@@ -6,8 +6,7 @@
...
@@ -6,8 +6,7 @@
package
main
package
main
func
main
()
func
main
()
{
{
var
a
[]
int
;
var
a
[]
int
;
var
ia
interface
{}
=
a
;
var
ia
interface
{}
=
a
;
var
m
=
make
(
map
[
interface
{}]
int
);
var
m
=
make
(
map
[
interface
{}]
int
);
...
...
test/cmp5.go
View file @
542099d7
...
@@ -6,8 +6,7 @@
...
@@ -6,8 +6,7 @@
package
main
package
main
func
main
()
func
main
()
{
{
var
b
[]
int
;
var
b
[]
int
;
var
ib
interface
{}
=
b
;
var
ib
interface
{}
=
b
;
var
m
=
make
(
map
[
interface
{}]
int
);
var
m
=
make
(
map
[
interface
{}]
int
);
...
...
test/convert.go
View file @
542099d7
...
@@ -22,9 +22,7 @@ func g() int {
...
@@ -22,9 +22,7 @@ func g() int {
type
T
func
()
int
type
T
func
()
int
var
m
=
map
[
string
]
T
{
var
m
=
map
[
string
]
T
{
"f"
:
f
}
"f"
:
f
}
type
A
int
type
A
int
type
B
int
type
B
int
...
...
test/float_lit.go
View file @
542099d7
...
@@ -7,16 +7,14 @@
...
@@ -7,16 +7,14 @@
package
main
package
main
func
func
pow10
(
pow
int
)
float64
pow10
(
pow
int
)
float64
{
{
if
pow
<
0
{
return
1
/
pow10
(
-
pow
);
}
if
pow
<
0
{
return
1
/
pow10
(
-
pow
);
}
if
pow
>
0
{
return
pow10
(
pow
-
1
)
*
10
;
}
if
pow
>
0
{
return
pow10
(
pow
-
1
)
*
10
;
}
return
1
;
return
1
;
}
}
func
func
close
(
da
float64
,
ia
,
ib
int64
,
pow
int
)
bool
close
(
da
float64
,
ia
,
ib
int64
,
pow
int
)
bool
{
{
db
:=
float64
(
ia
)
/
float64
(
ib
);
db
:=
float64
(
ia
)
/
float64
(
ib
);
db
*=
pow10
(
pow
);
db
*=
pow10
(
pow
);
...
@@ -39,8 +37,7 @@ close(da float64, ia, ib int64, pow int) bool
...
@@ -39,8 +37,7 @@ close(da float64, ia, ib int64, pow int) bool
}
}
func
func
main
()
main
()
{
{
if
!
close
(
0.
,
0
,
1
,
0
)
{
print
(
"0. is "
,
0.
,
"
\n
"
);
}
if
!
close
(
0.
,
0
,
1
,
0
)
{
print
(
"0. is "
,
0.
,
"
\n
"
);
}
if
!
close
(
+
10.
,
10
,
1
,
0
)
{
print
(
"+10. is "
,
+
10.
,
"
\n
"
);
}
if
!
close
(
+
10.
,
10
,
1
,
0
)
{
print
(
"+10. is "
,
+
10.
,
"
\n
"
);
}
...
...
test/indirect.go
View file @
542099d7
...
@@ -28,16 +28,14 @@ var b2 *[]int = &b0
...
@@ -28,16 +28,14 @@ var b2 *[]int = &b0
var
b3
[]
int
=
[]
int
{
1
,
2
,
3
}
var
b3
[]
int
=
[]
int
{
1
,
2
,
3
}
var
b4
*
[]
int
=
&
b3
var
b4
*
[]
int
=
&
b3
func
crash
()
func
crash
()
{
{
// these uses of nil pointers
// these uses of nil pointers
// would crash but should type check
// would crash but should type check
println
(
"crash"
,
println
(
"crash"
,
len
(
a1
)
+
cap
(
a1
));
len
(
a1
)
+
cap
(
a1
));
}
}
func
nocrash
()
func
nocrash
()
{
{
// this is spaced funny so that
// this is spaced funny so that
// the compiler will print a different
// the compiler will print a different
// line number for each len call if
// line number for each len call if
...
@@ -79,7 +77,6 @@ func nocrash()
...
@@ -79,7 +77,6 @@ func nocrash()
}
}
}
}
func
main
()
func
main
()
{
{
nocrash
();
nocrash
();
}
}
test/indirect1.go
View file @
542099d7
...
@@ -28,8 +28,7 @@ var b2 *[]int = &b0
...
@@ -28,8 +28,7 @@ var b2 *[]int = &b0
var
b3
[]
int
=
[]
int
{
1
,
2
,
3
}
var
b3
[]
int
=
[]
int
{
1
,
2
,
3
}
var
b4
*
[]
int
=
&
b3
var
b4
*
[]
int
=
&
b3
func
f
()
func
f
()
{
{
// this is spaced funny so that
// this is spaced funny so that
// the compiler will print a different
// the compiler will print a different
// line number for each len call when
// line number for each len call when
...
...
test/intcvt.go
View file @
542099d7
...
@@ -47,8 +47,7 @@ func chku64(i, v uint64) { if i != v { panicln(i, "!=", v) } }
...
@@ -47,8 +47,7 @@ func chku64(i, v uint64) { if i != v { panicln(i, "!=", v) } }
//func chkf32(f, v float32) { if f != v { panicln(f, "!=", v) } }
//func chkf32(f, v float32) { if f != v { panicln(f, "!=", v) } }
//func chkf64(f, v float64) { if f != v { panicln(f, "!=", v) } }
//func chkf64(f, v float64) { if f != v { panicln(f, "!=", v) } }
func
main
()
func
main
()
{
{
chki8
(
int8
(
i8
),
ci8
&
0xff
-
1
<<
8
);
chki8
(
int8
(
i8
),
ci8
&
0xff
-
1
<<
8
);
chki8
(
int8
(
i16
),
ci16
&
0xff
);
chki8
(
int8
(
i16
),
ci16
&
0xff
);
chki8
(
int8
(
i32
),
ci32
&
0xff
-
1
<<
8
);
chki8
(
int8
(
i32
),
ci32
&
0xff
-
1
<<
8
);
...
...
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