I am spending my New Year's eve watching Thai TV and coding.

below is the function I created to return a map. My function returns nil.

Am I missing something. 



type IcxParam struct {

        name  *string

        value *string

}

func MapIcxConfig(filenameconfig string)  map[string]IcxParam {

        var m = make(map[string]IcxParam)

        dat, err := ioutil.ReadFile(filenameconfig)

        check(err)


        m["version"] = m["version"].SetValues(`ver (\S+)`, dat)

        m["hostname"] = m["hostname"].SetValues(`hostname (\S+)`, dat)

        m["noTelnet"] = m["noTelnet"].SetValues(`telnet`, dat)

        m["ntp"] = m["ntp"].SetMultiValues(` server (\S+)`, dat)

        //m["ntp_num"] = m["ntp_num"].SetValues(`ver (\S+)`,dat)

        m["ipaddress"] = m["ip address"].SetValues(`ipaddress ([0-9.]+)`, 
dat)

        m["ipmask"] = m["ipmask"].SetValues(`ip address \S+( \S+|/\S+)`, 
dat)

        fmt.Printf("%v\n",keys(m))


        return m

}

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to