tutorial update and log cleanup

This commit is contained in:
edwardro22
2017-11-27 16:04:57 +00:00
committed by Dan Christian Bogos
parent 3fad468940
commit e227568cd2
3 changed files with 8 additions and 11 deletions

View File

@@ -22,7 +22,6 @@ import (
"bytes"
"encoding/json"
"fmt"
"log"
"reflect"
"regexp"
"strings"
@@ -68,7 +67,7 @@ func (ce *CommandExecuter) clientArgs(iface interface{}) (args []string) {
for i := 0; i < typ.NumField(); i++ {
valField := val.Field(i)
typeField := typ.Field(i)
log.Printf("%v (%v : %v)", typeField.Name, valField.Kind(), typeField.PkgPath)
//log.Printf("%v (%v : %v)", typeField.Name, valField.Kind(), typeField.PkgPath)
if len(typeField.PkgPath) > 0 { //unexported field
continue
}
@@ -77,7 +76,7 @@ func (ce *CommandExecuter) clientArgs(iface interface{}) (args []string) {
if valField.Kind() == reflect.Ptr {
valField = reflect.New(valField.Type().Elem()).Elem()
if valField.Kind() != reflect.Struct {
log.Printf("Here: %v (%v)", typeField.Name, valField.Kind())
//log.Printf("Here: %v (%v)", typeField.Name, valField.Kind())
args = append(args, typeField.Name)
continue
}