From e4cc1d2056068a8d1722b8df4561081777dbf6b9 Mon Sep 17 00:00:00 2001 From: Ryan Boehning Date: Sun, 17 Dec 2017 15:01:58 -0800 Subject: [PATCH] Remove unreachable code This makes gocode pass go vet ./... --- autocompletecontext.go | 1 - cursorcontext.go | 4 +--- decl.go | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/autocompletecontext.go b/autocompletecontext.go index d9f6a6ac..0a5c3598 100644 --- a/autocompletecontext.go +++ b/autocompletecontext.go @@ -659,7 +659,6 @@ func check_type_expr(e ast.Expr) bool { default: return true } - return true } //------------------------------------------------------------------------- diff --git a/cursorcontext.go b/cursorcontext.go index b4f8bff5..92c036b1 100644 --- a/cursorcontext.go +++ b/cursorcontext.go @@ -35,10 +35,8 @@ type token_item struct { func (i token_item) literal() string { if i.tok.IsLiteral() { return i.lit - } else { - return i.tok.String() } - return "" + return i.tok.String() } func new_token_iterator(src []byte, cursor int) token_iterator { diff --git a/decl.go b/decl.go index 17a3b3ba..7709c5fe 100644 --- a/decl.go +++ b/decl.go @@ -118,7 +118,6 @@ func ast_decl_type(d ast.Decl) ast.Expr { return t.Type } panic("unreachable") - return nil } func ast_decl_flags(d ast.Decl) decl_flags {