refact: minor refactoring

This commit is contained in:
evilsocket 2018-01-08 00:36:55 +01:00
parent 1913a88c59
commit 01bf914cd4
2 changed files with 4 additions and 3 deletions

View file

@ -20,7 +20,7 @@ build_file: resources
@echo " BuildDate = \"$(BUILD_DATE)\"" >> $(BUILD_FILE) @echo " BuildDate = \"$(BUILD_DATE)\"" >> $(BUILD_FILE)
@echo ")" >> $(BUILD_FILE) @echo ")" >> $(BUILD_FILE)
resources: deps resources:
@echo "@ Compiling resources into go files ..." @echo "@ Compiling resources into go files ..."
@go-bindata -o net/oui_compiled.go -pkg net net/oui.dat @go-bindata -o net/oui_compiled.go -pkg net net/oui.dat

View file

@ -39,8 +39,9 @@ func (env *Environment) Set(name, value string) string {
old, _ := env.storage[name] old, _ := env.storage[name]
env.storage[name] = value env.storage[name] = value
if len(name) > env.Padding { width := len(name)
env.Padding = len(name) if width > env.Padding {
env.Padding = width
} }
return old return old