Skip to content

Commit

Permalink
cleaned up typos in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ianlopshire committed Feb 27, 2018
1 parent ef28cb0 commit b5f5b05
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strconv"
)

// Unmarshal parses the fixed width encoded data and stores the
// Unmarshal parses fixed width encoded data and stores the
// result in the value pointed to by v. If v is nil or not a
// pointer, Unmarshal returns an InvalidUnmarshalError.
func Unmarshal(data []byte, v interface{}) error {
Expand Down Expand Up @@ -47,7 +47,7 @@ func (e *InvalidUnmarshalError) Error() string {
return "fixedwidth: Unmarshal(nil " + e.Type.String() + ")"
}

// An UnmarshalTypeError describes a value that was
// An UnmarshalTypeError describes a value that was
// not appropriate for a value of a specific Go type.
type UnmarshalTypeError struct {
Value string // the raw value
Expand All @@ -70,7 +70,7 @@ func (e *UnmarshalTypeError) Error() string {
return s
}

// Decode reads from its input and stores the decoded data the value
// Decode reads from its input and stores the decoded data to the value
// pointed to by v.
//
// In the case that v points to a struct value, Decode will read a
Expand Down
16 changes: 8 additions & 8 deletions encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@ import (
// line. If v is a single encodable type, a single line
// will be encoded.
//
// In order fot a type to be encodable, it must implement
// the encoding.TextMarshaler interface or be base on one
// In order for a type to be encodable, it must implement
// the encoding.TextMarshaler interface or be based on one
// of the following builtin types: string, int, int64,
// int32, int16, int8, float64, float32, or struct.
// Pointers to encodable types and interfaces containing
// encodable types are also encodable.
//
// nil pointers and interface will be omitted. zero vales
// nil pointers and interfaces will be omitted. zero vales
// will be encoded normally.
//
// A struct is be encoded to a single slice of bytes. Each
// A struct is encoded to a single slice of bytes. Each
// field in a struct will be encoded and placed at the
// position defined by its struct tags. The tags should be
// formatted as `fixed:"{startPos},{endPos}"`. Positions
// start at 1. The interval is inclusive. Fields without
// tags and Fields or an un-encodable type are ignored.
// tags and Fields of an un-encodable type are ignored.
//
// If the encoded value of a field is longer than what is
// allowed by the fields position interval, the overflow is
// ignored.
// If the encoded value of a field is longer than the
// length of the position interval, the overflow is
// truncated.
func Marshal(v interface{}) ([]byte, error) {
buff := bytes.NewBuffer(nil)
err := NewEncoder(buff).Encode(v)
Expand Down

0 comments on commit b5f5b05

Please sign in to comment.