From 97507a4bf930e13f607d9b920a5af5ab84ba5fa0 Mon Sep 17 00:00:00 2001 From: cos Date: Sun, 11 Mar 2018 18:35:49 +0800 Subject: White space + break long lines. --- hisgle.go | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/hisgle.go b/hisgle.go index f1cb6cf..de01ce9 100644 --- a/hisgle.go +++ b/hisgle.go @@ -20,8 +20,8 @@ func ethers(db *sql.DB, vlan int) { ipv4 string ) -//CREATE TABLE devices (name, mac, interface); -//CREATE TABLE addresses (mac, vlan, ipv4); + // CREATE TABLE devices (name, mac, interface); + // CREATE TABLE addresses (mac, vlan, ipv4); rows, err := db.Query("SELECT mac, ipv4 FROM addresses WHERE vlan=?", vlan) if err != nil { @@ -43,10 +43,11 @@ func hosts(db *sql.DB, vlan int) { alias string ) -//CREATE TABLE devices (name, mac, interface); -//CREATE TABLE addresses (mac, vlan, ipv4); + // CREATE TABLE devices (name, mac, interface); + // CREATE TABLE addresses (mac, vlan, ipv4); - rows, err := db.Query("SELECT a.ipv4, d.name FROM addresses AS a JOIN devices AS d ON a.mac=d.mac WHERE vlan=?", vlan) + rows, err := db.Query("SELECT a.ipv4, d.name FROM addresses AS a JOIN " + + "devices AS d ON a.mac=d.mac WHERE vlan=?", vlan) if err != nil { log.Fatal(err) } @@ -57,7 +58,7 @@ func hosts(db *sql.DB, vlan int) { } fmt.Print(ipv4, "\t", name) -// CREATE TABLE aliases (alias, target); + // CREATE TABLE aliases (alias, target); rows, err := db.Query("SELECT alias FROM aliases WHERE target=?", name) if err != nil { log.Fatal(err) @@ -79,7 +80,8 @@ func main() { ipv4 string ) - optDatabase := getopt.StringLong("database", 'd', "", "Path to SQLite3 database file with device addresses") + optDatabase := getopt.StringLong("database", 'd', "", + "Path to SQLite3 database file with device addresses") optHelp := getopt.BoolLong("help", 0, "Help") getopt.SetParameters("{ethers|hosts} list_of_networks") getopt.Parse() @@ -97,7 +99,8 @@ func main() { for _, arg := range args[1:] { vlan, _ := strconv.Atoi(arg) - rows, err := db.Query("SELECT description, ipv4 FROM networks WHERE vlan=?", vlan) + rows, err := db.Query( + "SELECT description, ipv4 FROM networks WHERE vlan=?", vlan) if err != nil { log.Fatal(err) } -- cgit v1.2.3