]> Cypherpunks repositories - gostls13.git/commitdiff
fixes for funcs without returns
authorRob Pike <r@golang.org>
Thu, 11 Sep 2008 22:48:42 +0000 (15:48 -0700)
committerRob Pike <r@golang.org>
Thu, 11 Sep 2008 22:48:42 +0000 (15:48 -0700)
R=ken
OCL=15170
CL=15170

src/lib/flag.go
src/lib/math/hypot.go
src/lib/math/pow.go
src/lib/os/os_error.go
test/chan/powser1.go
test/fixedbugs/bug028.go
test/fixedbugs/bug086.go [moved from test/bugs/bug086.go with 100% similarity]
test/golden.out

index acf3424db39f786cf267f90eb29bd75bacf5f837..351159c179e54968791710ecc7850ac6d0511ba9 100644 (file)
@@ -144,9 +144,7 @@ func (b *BoolValue) Str() string {
        if b.val {
                return "true"
        }
-       else {
-               return "false"
-       }
+       return "false"
 }
 
 func NewBoolValue(b bool, p *bool) *BoolValue {
index 3b3c1e510ac250a4ef356694e61a5e409b08f113..d1afac9e3fe9292ae220991c8ff30bedd20cca70 100644 (file)
@@ -49,4 +49,5 @@ hypot(p, q float64) float64
                q = q*r;
                r = q/p;
        }
+       panic("unreachable")
 }
index 8adb72132a9104db72c47bca998ec72812eb587a..590b0114b8cdb0b1587df95dfd5be46bc9612e55 100644 (file)
@@ -62,4 +62,5 @@ pow(arg1,arg2 float64) float64
                }
                arg1 *= arg1;
        }
+       panic("unreachable")
 }
index 16799ed5e361505ff7623fb77fec43c23846a1d7..21e1bc6272d8081fa3b3405cda3e9a4125e4ec2a 100644 (file)
@@ -70,7 +70,6 @@ const NoError = "No Error"
 func (e *Error) String() string {
        if e == nil {
                return NoError
-       } else {
-               return e.s
        }
+       return e.s
 }
index e737c55bfe9642b847dbdb1bd5df1535f68c8ade..a978a32ca530c88abc90a4dfb1f991ebe55f7c07 100644 (file)
@@ -382,7 +382,7 @@ func Monmul(U PS, n int) PS{
 // Multiply by x
 
 func Xmul(U PS) PS{
-       Monmul(U,1);
+       return Monmul(U,1);
 }
 
 func Rep(c *rat) PS{
index 7ec016c4547f1c1755a8dd10c00151dfd63df830..0488ad2cba8d3e46f9f5a5840ad4d1f2d947e572 100644 (file)
@@ -16,6 +16,7 @@ func Alloc(i int) int {
        case 10:
                return 10;
        }
+       return 0
 }
 
 func main() {
similarity index 100%
rename from test/bugs/bug086.go
rename to test/fixedbugs/bug086.go
index db1a9f37cecab64a6853ad0ae645e0307e054226..0ff2e357b1a205a7b4dcf57b462e59f3029f4a3a 100644 (file)
@@ -226,5 +226,8 @@ fixedbugs/bug073.go:9: illegal types for operand: RSH
 =========== fixedbugs/bug081.go
 fixedbugs/bug081.go:5: syntax error
 
+=========== fixedbugs/bug086.go
+fixedbugs/bug086.go:5: function ends without a return statement
+
 =========== fixedbugs/bug091.go
 fixedbugs/bug091.go:14: label exit not defined