Skip to content

Commit

Permalink
delete minor unreachable code caused by t.Fatal or log.Fatal (#4219)
Browse files Browse the repository at this point in the history
Signed-off-by: Abirdcfly <[email protected]>
  • Loading branch information
Abirdcfly authored Aug 5, 2022
1 parent fce0346 commit 2b1018d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 8 deletions.
1 change: 0 additions & 1 deletion cli/bundler/bundler.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ func (b *Bundler) Build(ctx *kingpin.ParseContext) error {
ch := text[0:1]
if ch != "y" {
log.Fatal("Aborting")
os.Exit(1)
}
}
} else {
Expand Down
4 changes: 0 additions & 4 deletions cli/importer/importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,19 @@ func (i *Importer) Import(ctx *kingpin.ParseContext) (err error) {
err = i.handleSwaggerMode()
if err != nil {
log.Fatal(err)
os.Exit(1)
}
} else if *i.bluePrintMode {
err = i.handleBluePrintMode()
if err != nil {
log.Fatal(err)
os.Exit(1)
}
} else if *i.wsdlMode {
err = i.handleWSDLMode()
if err != nil {
log.Fatal(err)
os.Exit(1)
}
} else {
log.Fatal(errUnknownMode)
os.Exit(1)
}
os.Exit(0)
return nil
Expand Down
3 changes: 0 additions & 3 deletions test/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,14 @@ func (r TCPTestRunner) Run(t testing.TB, testCases ...TCPTestCase) error {
if tc.ErrorMatch != "" {
if err == nil {
t.Fatalf("[%d] Expected error: %s", ti, tc.ErrorMatch)
break
}

if !strings.Contains(err.Error(), tc.ErrorMatch) {
t.Fatalf("[%d] Expected error %s, got %s", ti, err.Error(), tc.ErrorMatch)
break
}
} else {
if err != nil {
t.Fatalf("[%d] Unexpected error: %s", ti, err.Error())
break
}
}
}
Expand Down

0 comments on commit 2b1018d

Please sign in to comment.