Это потому, что вы все еще удерживаете значение по умолчанию до вызова flag.Parse()
:
// still holding the "configfile" as value
cmdSt.configPtr = *flag.String("c", "configfile", "configure file to parse ")
// still holding the "interface" as value
cmdSt.interfacePtr = *flag.String("i", "interface", "capture network interface")
// flag is parsed now, but both cmdSt.configPtr and cmdSt.interfacePtr still holding the default value because of the pointer.
flag.Parse()
Вы можете решить проблему, используя временные переменные:
// hold the value to temporary variables
a := flag.String("c", "configfile", "configure file to parse ")
b := flag.String("i", "interface", "capture network interface")
// parse the flag and save to the variables.
flag.Parse()
// now, point the value to the CmdSt struct
cmdSt.configPtr = *a
cmdSt.interfacePtr = *b
fmt.Println("c", cmdSt.configPtr)
fmt.Println("i", cmdSt.interfacePtr)