Skip to content

Commit

Permalink
correctly handle missing device selector
Browse files Browse the repository at this point in the history
  • Loading branch information
wg committed Dec 12, 2016
1 parent f0d3eeb commit 218464f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/github.com/kentik/libkflow/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
// #include "kflow.h"
import "C"
import (
"fmt"
"net/url"
"reflect"
"time"
Expand Down Expand Up @@ -39,6 +40,8 @@ func kflowInit(cfg *C.kflowConfig) C.int {
device, err = client.GetDeviceByID(url, int(cfg.device_id))
case cfg.hostname != nil:
device, err = client.GetDeviceByName(url, C.GoString(cfg.hostname))
default:
err = fmt.Errorf("config: missing device selector")
}

if err != nil {
Expand Down

0 comments on commit 218464f

Please sign in to comment.