diff --git a/decode.go b/decode.go index bf8162c..a565e66 100644 --- a/decode.go +++ b/decode.go @@ -208,6 +208,8 @@ func rawValueFromLine(value rawValue, startPos, endPos int, format format) rawVa trimFunc = func(s string) string { return strings.TrimLeft(s, string(format.padChar)) } + case noAlignment: + trimFunc = func(s string) string { return s } default: trimFunc = func(s string) string { return strings.Trim(s, string(format.padChar)) diff --git a/format.go b/format.go index 9c83611..c60d461 100644 --- a/format.go +++ b/format.go @@ -2,6 +2,7 @@ package fixedwidth const ( defaultAlignment alignment = "default" + noAlignment alignment = "none" right alignment = "right" left alignment = "left" ) @@ -24,7 +25,7 @@ type alignment string func (a alignment) Valid() bool { switch a { - case defaultAlignment, right, left: + case defaultAlignment, right, left, noAlignment: return true default: return false