Skip to content

Commit

Permalink
improved the error handling a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Bayfield authored and nranchev committed Feb 21, 2011
1 parent efb29ba commit f90fb46
Show file tree
Hide file tree
Showing 2 changed files with 139 additions and 133 deletions.
8 changes: 4 additions & 4 deletions example.go
Expand Up @@ -11,7 +11,7 @@ func main() {

// Check the number of arguments
if flag.NArg() < 2 {
fmt.Printf("usage: main DBFILE IPADDRESS\n");
fmt.Printf("usage: main DBFILE IPADDRESS\n")
return
}

Expand All @@ -20,9 +20,9 @@ func main() {
ipAddr := flag.Arg(1)

// Load the database file, exit on failure
gi := libgeo.Load(dbFile)
if gi == nil {
fmt.Printf("GI IS NULL!\n");
gi, err := libgeo.Load(dbFile)
if err != nil {
fmt.Printf("Error: " + err.String() + "\n")
return
}

Expand Down

0 comments on commit f90fb46

Please sign in to comment.