Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(54)

Issue 7877045: code review 7877045: build: remove dead code (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 1 month ago by rsc
Modified:
12 years, 1 month ago
Reviewers:
bradfitz
CC:
golang-dev, r
Visibility:
Public.

Description

build: remove dead code

Patch Set 1 #

Patch Set 2 : diff -r e0a30ff5c961 https://code.google.com/p/go/ #

Patch Set 3 : diff -r e0a30ff5c961 https://code.google.com/p/go/ #

Patch Set 4 : diff -r 9c66fd61d54f https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -38 lines) Patch
M src/cmd/go/discovery.go View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/cmd/yacc/yacc.go View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/compress/flate/inflate.go View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/compress/gzip/gunzip.go View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/compress/lzw/reader.go View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/crypto/dsa/dsa_test.go View 1 1 chunk +3 lines, -2 lines 0 comments Download
M src/pkg/crypto/rand/util.go View 1 2 chunks +0 lines, -4 lines 0 comments Download
M src/pkg/encoding/asn1/marshal.go View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/encoding/csv/reader.go View 1 2 chunks +0 lines, -2 lines 0 comments Download
M src/pkg/encoding/gob/decode.go View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/encoding/gob/type.go View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/encoding/json/decode.go View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/html/template/transition.go View 1 2 chunks +0 lines, -2 lines 0 comments Download
M src/pkg/math/big/nat.go View 1 1 chunk +0 lines, -2 lines 0 comments Download
M src/pkg/net/http/httputil/reverseproxy.go View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/net/ip.go View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/net/unixsock_posix.go View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/os/file_posix.go View 1 1 chunk +0 lines, -2 lines 0 comments Download
M src/pkg/os/getwd.go View 1 1 chunk +0 lines, -2 lines 0 comments Download
M src/pkg/reflect/tostring_test.go View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/strconv/extfloat.go View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/syscall/exec_bsd.go View 1 1 chunk +0 lines, -5 lines 0 comments Download
M src/pkg/testing/quick/quick.go View 1 1 chunk +0 lines, -2 lines 0 comments Download
M src/pkg/text/template/parse/parse.go View 1 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 4
rsc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
12 years, 1 month ago (2013-03-22 21:23:02 UTC) #1
r
LGTM
12 years, 1 month ago (2013-03-22 21:27:30 UTC) #2
rsc
*** Submitted as https://code.google.com/p/go/source/detail?r=b0d920685dda *** build: remove dead code R=golang-dev, r CC=golang-dev https://codereview.appspot.com/7877045
12 years, 1 month ago (2013-03-22 21:28:26 UTC) #3
bradfitz
12 years, 1 month ago (2013-03-22 22:01:06 UTC) #4
LGTM
 On Mar 22, 2013 2:23 PM, <rsc@golang.org> wrote:

> Reviewers: golang-dev1,
>
> Message:
> Hello golang-dev@googlegroups.com,
>
> I'd like you to review this change to
> https://code.google.com/p/go/
>
>
> Description:
> build: remove dead code
>
> Please review this at
https://codereview.appspot.**com/7877045/<https://codereview.appspot.com/7877...
>
> Affected files:
>   M src/cmd/go/discovery.go
>   M src/cmd/yacc/yacc.go
>   M src/pkg/compress/flate/**inflate.go
>   M src/pkg/compress/gzip/gunzip.**go
>   M src/pkg/compress/lzw/reader.go
>   M src/pkg/crypto/dsa/dsa_test.go
>   M src/pkg/crypto/rand/util.go
>   M src/pkg/encoding/asn1/marshal.**go
>   M src/pkg/encoding/csv/reader.go
>   M src/pkg/encoding/gob/decode.go
>   M src/pkg/encoding/gob/type.go
>   M src/pkg/encoding/json/decode.**go
>   M src/pkg/html/template/**transition.go
>   M src/pkg/math/big/nat.go
>   M src/pkg/net/http/httputil/**reverseproxy.go
>   M src/pkg/net/ip.go
>   M src/pkg/net/unixsock_posix.go
>   M src/pkg/os/file_posix.go
>   M src/pkg/os/getwd.go
>   M src/pkg/reflect/tostring_test.**go
>   M src/pkg/strconv/extfloat.go
>   M src/pkg/syscall/exec_bsd.go
>   M src/pkg/testing/quick/quick.go
>   M src/pkg/text/template/parse/**parse.go
>
>
> Index: src/cmd/go/discovery.go
> ==============================**==============================**=======
> --- a/src/cmd/go/discovery.go
> +++ b/src/cmd/go/discovery.go
> @@ -48,7 +48,6 @@
>                         })
>                 }
>         }
> -       return
>  }
>
>  // attrValue returns the attribute value for the case-insensitive key
> Index: src/cmd/yacc/yacc.go
> ==============================**==============================**=======
> --- a/src/cmd/yacc/yacc.go
> +++ b/src/cmd/yacc/yacc.go
> @@ -3164,7 +3164,6 @@
>
>  func write(f *bufio.Writer, b []byte, n int) int {
>         panic("write")
> -       return 0
>  }
>
>  func open(s string) *bufio.Reader {
> Index: src/pkg/compress/flate/**inflate.go
> ==============================**==============================**=======
> --- a/src/pkg/compress/flate/**inflate.go
> +++ b/src/pkg/compress/flate/**inflate.go
> @@ -640,7 +640,6 @@
>                         return int(chunk >> huffmanValueShift), nil
>                 }
>         }
> -       return 0, CorruptInputError(f.roffset)
>  }
>
>  // Flush any buffered output to the underlying writer.
> Index: src/pkg/compress/gzip/gunzip.**go
> ==============================**==============================**=======
> --- a/src/pkg/compress/gzip/**gunzip.go
> +++ b/src/pkg/compress/gzip/**gunzip.go
> @@ -120,7 +120,6 @@
>                         return string(z.buf[0:i]), nil
>                 }
>         }
> -       panic("not reached")
>  }
>
>  func (z *Reader) read2() (uint32, error) {
> Index: src/pkg/compress/lzw/reader.go
> ==============================**==============================**=======
> --- a/src/pkg/compress/lzw/reader.**go
> +++ b/src/pkg/compress/lzw/reader.**go
> @@ -202,7 +202,6 @@
>                         return
>                 }
>         }
> -       panic("unreachable")
>  }
>
>  func (d *decoder) flush() {
> Index: src/pkg/crypto/dsa/dsa_test.go
> ==============================**==============================**=======
> --- a/src/pkg/crypto/dsa/dsa_test.**go
> +++ b/src/pkg/crypto/dsa/dsa_test.**go
> @@ -63,8 +63,9 @@
>  }
>
>  func TestParameterGeneration(t *testing.T) {
> -       // This test is too slow to run all the time.
> -       return
> +       if testing.Short() {
> +               t.Skip("skipping parameter generation test in short mode")
> +       }
>
>         testParameterGeneration(t, L1024N160, 1024, 160)
>         testParameterGeneration(t, L2048N224, 2048, 224)
> Index: src/pkg/crypto/rand/util.go
> ==============================**==============================**=======
> --- a/src/pkg/crypto/rand/util.go
> +++ b/src/pkg/crypto/rand/util.go
> @@ -98,8 +98,6 @@
>                         return
>                 }
>         }
> -
> -       return
>  }
>
>  // Int returns a uniform random value in [0, max).
> @@ -130,6 +128,4 @@
>                         return
>                 }
>         }
> -
> -       return
>  }
> Index: src/pkg/encoding/asn1/marshal.**go
> ==============================**==============================**=======
> --- a/src/pkg/encoding/asn1/**marshal.go
> +++ b/src/pkg/encoding/asn1/**marshal.go
> @@ -460,7 +460,6 @@
>                 default:
>                         return marshalUTF8String(out, v.String())
>                 }
> -               return
>         }
>
>         return StructuralError{"unknown Go type"}
> Index: src/pkg/encoding/csv/reader.go
> ==============================**==============================**=======
> --- a/src/pkg/encoding/csv/reader.**go
> +++ b/src/pkg/encoding/csv/reader.**go
> @@ -212,7 +212,6 @@
>                         return nil
>                 }
>         }
> -       panic("unreachable")
>  }
>
>  // parseRecord reads and parses a single csv record from r.
> @@ -249,7 +248,6 @@
>                         return nil, err
>                 }
>         }
> -       panic("unreachable")
>  }
>
>  // parseField parses the next field in the record.  The read field is
> Index: src/pkg/encoding/gob/decode.go
> ==============================**==============================**=======
> --- a/src/pkg/encoding/gob/decode.**go
> +++ b/src/pkg/encoding/gob/decode.**go
> @@ -1066,7 +1066,6 @@
>         case reflect.Struct:
>                 return true
>         }
> -       return true
>  }
>
>  // typeString returns a human-readable description of the type identified
> by remoteId.
> Index: src/pkg/encoding/gob/type.go
> ==============================**==============================**=======
> --- a/src/pkg/encoding/gob/type.go
> +++ b/src/pkg/encoding/gob/type.go
> @@ -526,7 +526,6 @@
>         default:
>                 return nil, errors.New("gob NewTypeObject can't handle
> type: " + rt.String())
>         }
> -       return nil, nil
>  }
>
>  // isExported reports whether this is an exported - upper case - name.
> Index: src/pkg/encoding/json/decode.**go
> ==============================**==============================**=======
> --- a/src/pkg/encoding/json/**decode.go
> +++ b/src/pkg/encoding/json/**decode.go
> @@ -868,7 +868,6 @@
>                 }
>                 return n
>         }
> -       panic("unreachable")
>  }
>
>  // getu4 decodes \uXXXX from the beginning of s, returning the hex value,
> Index: src/pkg/html/template/**transition.go
> ==============================**==============================**=======
> --- a/src/pkg/html/template/**transition.go
> +++ b/src/pkg/html/template/**transition.go
> @@ -429,7 +429,6 @@
>                 }
>                 k = i + 1
>         }
> -       panic("unreachable")
>  }
>
>  // tCSSStr is the context transition function for the CSS string and URL
> states.
> @@ -470,7 +469,6 @@
>                 c, _ = tURL(c, decodeCSS(s[:i+1]))
>                 k = i + 1
>         }
> -       panic("unreachable")
>  }
>
>  // tError is the context transition function for the error state.
> Index: src/pkg/math/big/nat.go
> ==============================**==============================**=======
> --- a/src/pkg/math/big/nat.go
> +++ b/src/pkg/math/big/nat.go
> @@ -1021,8 +1021,6 @@
>         default:
>                 panic("unknown word size")
>         }
> -
> -       return 0
>  }
>
>  // trailingZeroBits returns the number of consecutive least significant
> zero
> Index: src/pkg/net/http/httputil/**reverseproxy.go
> ==============================**==============================**=======
> --- a/src/pkg/net/http/httputil/**reverseproxy.go
> +++ b/src/pkg/net/http/httputil/**reverseproxy.go
> @@ -202,7 +202,6 @@
>                         m.lk.Unlock()
>                 }
>         }
> -       panic("unreached")
>  }
>
>  func (m *maxLatencyWriter) stop() { m.done <- true }
> Index: src/pkg/net/ip.go
> ==============================**==============================**=======
> --- a/src/pkg/net/ip.go
> +++ b/src/pkg/net/ip.go
> @@ -222,7 +222,6 @@
>         default:
>                 return classCMask
>         }
> -       return nil // not reached
>  }
>
>  func allFF(b []byte) bool {
> Index: src/pkg/net/unixsock_posix.go
> ==============================**==============================**=======
> --- a/src/pkg/net/unixsock_posix.**go
> +++ b/src/pkg/net/unixsock_posix.**go
> @@ -99,7 +99,6 @@
>         default:
>                 panic("sotypeToNet unknown socket type")
>         }
> -       return ""
>  }
>
>  // UnixConn is an implementation of the Conn interface for connections
> Index: src/pkg/os/file_posix.go
> ==============================**==============================**=======
> --- a/src/pkg/os/file_posix.go
> +++ b/src/pkg/os/file_posix.go
> @@ -46,8 +46,6 @@
>                         return string(b[0:n]), nil
>                 }
>         }
> -       // Silence 6g.
> -       return "", nil
>  }
>
>  // Rename renames a file.
> Index: src/pkg/os/getwd.go
> ==============================**==============================**=======
> --- a/src/pkg/os/getwd.go
> +++ b/src/pkg/os/getwd.go
> @@ -90,8 +90,6 @@
>                                 }
>                         }
>                 }
> -               fd.Close()
> -               return "", ErrNotExist
>
>         Found:
>                 pd, err := fd.Stat()
> Index: src/pkg/reflect/tostring_test.**go
> ==============================**==============================**=======
> --- a/src/pkg/reflect/tostring_**test.go
> +++ b/src/pkg/reflect/tostring_**test.go
> @@ -92,5 +92,4 @@
>         default:
>                 panic("valueToString: can't print type " + typ.String())
>         }
> -       return "valueToString: can't happen"
>  }
> Index: src/pkg/strconv/extfloat.go
> ==============================**==============================**=======
> --- a/src/pkg/strconv/extfloat.go
> +++ b/src/pkg/strconv/extfloat.go
> @@ -636,7 +636,6 @@
>                                 1<<shift, multiplier*2)
>                 }
>         }
> -       return false
>  }
>
>  // adjustLastDigit modifies d = x-currentDiff*ε, to get closest to
> Index: src/pkg/syscall/exec_bsd.go
> ==============================**==============================**=======
> --- a/src/pkg/syscall/exec_bsd.go
> +++ b/src/pkg/syscall/exec_bsd.go
> @@ -215,11 +215,6 @@
>         for {
>                 RawSyscall(SYS_EXIT, 253, 0, 0)
>         }
> -
> -       // Calling panic is not actually safe,
> -       // but the for loop above won't break
> -       // and this shuts up the compiler.
> -       panic("unreached")
>  }
>
>  // Try to open a pipe with O_CLOEXEC set on both file descriptors.
> Index: src/pkg/testing/quick/quick.go
> ==============================**==============================**=======
> --- a/src/pkg/testing/quick/quick.**go
> +++ b/src/pkg/testing/quick/quick.**go
> @@ -140,8 +140,6 @@
>         default:
>                 return reflect.Value{}, false
>         }
> -
> -       return
>  }
>
>  // A Config structure contains options for running a test.
> Index: src/pkg/text/template/parse/**parse.go
> ==============================**==============================**=======
> --- a/src/pkg/text/template/parse/**parse.go
> +++ b/src/pkg/text/template/parse/**parse.go
> @@ -429,7 +429,6 @@
>                         t.unexpected(token, context)
>                 }
>         }
> -       return
>  }
>
>  func (t *Tree) parseControl(context string) (pos Pos, line int, pipe
> *PipeNode, list, elseList *ListNode) {
>
>
> --
>
> ---You received this message because you are subscribed to the Google
> Groups "golang-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
golang-dev+unsubscribe@**googlegroups.com<golang-dev%2Bunsubscribe@googlegrou...
> .
> For more options, visit
https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/o...
> .
>
>
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b