From 410974497365b2e6e23811dbc58475b00c69d0db Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Thu, 21 Jul 2016 15:25:22 -0700 Subject: [PATCH] syscall: delete unreachable code Change-Id: Iacedb792c73591b7fd75e836aab8e0e117c8e738 Reviewed-on: https://go-review.googlesource.com/27494 Run-TryBot: Josh Bleecher Snyder Reviewed-by: Brad Fitzpatrick --- src/syscall/dll_windows.go | 1 - src/syscall/exec_plan9.go | 5 ----- src/syscall/exec_windows.go | 2 -- 3 files changed, 8 deletions(-) diff --git a/src/syscall/dll_windows.go b/src/syscall/dll_windows.go index e5638480b7..864473b43b 100644 --- a/src/syscall/dll_windows.go +++ b/src/syscall/dll_windows.go @@ -176,7 +176,6 @@ func (p *Proc) Call(a ...uintptr) (r1, r2 uintptr, lastErr error) { default: panic("Call " + p.Name + " with too many arguments " + itoa(len(a)) + ".") } - return } // A LazyDLL implements access to a single DLL. diff --git a/src/syscall/exec_plan9.go b/src/syscall/exec_plan9.go index 6551bcb1c1..47ccbdc384 100644 --- a/src/syscall/exec_plan9.go +++ b/src/syscall/exec_plan9.go @@ -298,11 +298,6 @@ childerror1: for { RawSyscall(SYS_EXITS, 0, 0, 0) } - - // Calling panic is not actually safe, - // but the for loop above won't break - // and this shuts up the compiler. - panic("unreached") } // close the numbered file descriptor, unless it is fd1, fd2, or a member of fds. diff --git a/src/syscall/exec_windows.go b/src/syscall/exec_windows.go index 5a01843d2b..cafce1eff6 100644 --- a/src/syscall/exec_windows.go +++ b/src/syscall/exec_windows.go @@ -209,8 +209,6 @@ func joinExeDirAndFName(dir, p string) (name string, err error) { return FullPath(d + "\\" + p) } } - // we shouldn't be here - return "", EINVAL } type ProcAttr struct { -- 2.48.1