Skip to content

Commit

Permalink
Merge pull request go-openapi#39 from alexandear/fix-typos-in-comments
Browse files Browse the repository at this point in the history
Fix typos in comments
  • Loading branch information
casualjim authored Dec 24, 2019
2 parents 8a84ec6 + 9e4375e commit 6a1eb98
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 42 deletions.
16 changes: 8 additions & 8 deletions convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func ConvertFloat64(str string) (float64, error) {
return strconv.ParseFloat(str, 64)
}

// ConvertInt8 turn a string into int8 boolean
// ConvertInt8 turn a string into an int8
func ConvertInt8(str string) (int8, error) {
i, err := strconv.ParseInt(str, 10, 8)
if err != nil {
Expand All @@ -97,7 +97,7 @@ func ConvertInt8(str string) (int8, error) {
return int8(i), nil
}

// ConvertInt16 turn a string into a int16
// ConvertInt16 turn a string into an int16
func ConvertInt16(str string) (int16, error) {
i, err := strconv.ParseInt(str, 10, 16)
if err != nil {
Expand All @@ -106,7 +106,7 @@ func ConvertInt16(str string) (int16, error) {
return int16(i), nil
}

// ConvertInt32 turn a string into a int32
// ConvertInt32 turn a string into an int32
func ConvertInt32(str string) (int32, error) {
i, err := strconv.ParseInt(str, 10, 32)
if err != nil {
Expand All @@ -115,12 +115,12 @@ func ConvertInt32(str string) (int32, error) {
return int32(i), nil
}

// ConvertInt64 turn a string into a int64
// ConvertInt64 turn a string into an int64
func ConvertInt64(str string) (int64, error) {
return strconv.ParseInt(str, 10, 64)
}

// ConvertUint8 turn a string into a uint8
// ConvertUint8 turn a string into an uint8
func ConvertUint8(str string) (uint8, error) {
i, err := strconv.ParseUint(str, 10, 8)
if err != nil {
Expand All @@ -129,7 +129,7 @@ func ConvertUint8(str string) (uint8, error) {
return uint8(i), nil
}

// ConvertUint16 turn a string into a uint16
// ConvertUint16 turn a string into an uint16
func ConvertUint16(str string) (uint16, error) {
i, err := strconv.ParseUint(str, 10, 16)
if err != nil {
Expand All @@ -138,7 +138,7 @@ func ConvertUint16(str string) (uint16, error) {
return uint16(i), nil
}

// ConvertUint32 turn a string into a uint32
// ConvertUint32 turn a string into an uint32
func ConvertUint32(str string) (uint32, error) {
i, err := strconv.ParseUint(str, 10, 32)
if err != nil {
Expand All @@ -147,7 +147,7 @@ func ConvertUint32(str string) (uint32, error) {
return uint32(i), nil
}

// ConvertUint64 turn a string into a uint64
// ConvertUint64 turn a string into an uint64
func ConvertUint64(str string) (uint64, error) {
return strconv.ParseUint(str, 10, 64)
}
Expand Down
60 changes: 30 additions & 30 deletions convert_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,12 @@ func IntValueMap(src map[string]*int) map[string]int {
return dst
}

// Int32 returns a pointer to of the int64 value passed in.
// Int32 returns a pointer to of the int32 value passed in.
func Int32(v int32) *int32 {
return &v
}

// Int32Value returns the value of the int64 pointer passed in or
// Int32Value returns the value of the int32 pointer passed in or
// 0 if the pointer is nil.
func Int32Value(v *int32) int32 {
if v != nil {
Expand All @@ -195,7 +195,7 @@ func Int32Value(v *int32) int32 {
return 0
}

// Int32Slice converts a slice of int64 values into a slice of
// Int32Slice converts a slice of int32 values into a slice of
// int32 pointers
func Int32Slice(src []int32) []*int32 {
dst := make([]*int32, len(src))
Expand Down Expand Up @@ -299,22 +299,22 @@ func Int64ValueMap(src map[string]*int64) map[string]int64 {
return dst
}

// Uint returns a pouinter to of the uint value passed in.
// Uint returns a pointer to of the uint value passed in.
func Uint(v uint) *uint {
return &v
}

// UintValue returns the value of the uint pouinter passed in or
// 0 if the pouinter is nil.
// UintValue returns the value of the uint pointer passed in or
// 0 if the pointer is nil.
func UintValue(v *uint) uint {
if v != nil {
return *v
}
return 0
}

// UintSlice converts a slice of uint values uinto a slice of
// uint pouinters
// UintSlice converts a slice of uint values into a slice of
// uint pointers
func UintSlice(src []uint) []*uint {
dst := make([]*uint, len(src))
for i := 0; i < len(src); i++ {
Expand All @@ -323,7 +323,7 @@ func UintSlice(src []uint) []*uint {
return dst
}

// UintValueSlice converts a slice of uint pouinters uinto a slice of
// UintValueSlice converts a slice of uint pointers into a slice of
// uint values
func UintValueSlice(src []*uint) []uint {
dst := make([]uint, len(src))
Expand All @@ -335,8 +335,8 @@ func UintValueSlice(src []*uint) []uint {
return dst
}

// UintMap converts a string map of uint values uinto a string
// map of uint pouinters
// UintMap converts a string map of uint values into a string
// map of uint pointers
func UintMap(src map[string]uint) map[string]*uint {
dst := make(map[string]*uint)
for k, val := range src {
Expand All @@ -346,7 +346,7 @@ func UintMap(src map[string]uint) map[string]*uint {
return dst
}

// UintValueMap converts a string map of uint pouinters uinto a string
// UintValueMap converts a string map of uint pointers into a string
// map of uint values
func UintValueMap(src map[string]*uint) map[string]uint {
dst := make(map[string]uint)
Expand All @@ -358,22 +358,22 @@ func UintValueMap(src map[string]*uint) map[string]uint {
return dst
}

// Uint32 returns a pouinter to of the uint64 value passed in.
// Uint32 returns a pointer to of the uint32 value passed in.
func Uint32(v uint32) *uint32 {
return &v
}

// Uint32Value returns the value of the uint64 pouinter passed in or
// 0 if the pouinter is nil.
// Uint32Value returns the value of the uint32 pointer passed in or
// 0 if the pointer is nil.
func Uint32Value(v *uint32) uint32 {
if v != nil {
return *v
}
return 0
}

// Uint32Slice converts a slice of uint64 values uinto a slice of
// uint32 pouinters
// Uint32Slice converts a slice of uint32 values into a slice of
// uint32 pointers
func Uint32Slice(src []uint32) []*uint32 {
dst := make([]*uint32, len(src))
for i := 0; i < len(src); i++ {
Expand All @@ -382,7 +382,7 @@ func Uint32Slice(src []uint32) []*uint32 {
return dst
}

// Uint32ValueSlice converts a slice of uint32 pouinters uinto a slice of
// Uint32ValueSlice converts a slice of uint32 pointers into a slice of
// uint32 values
func Uint32ValueSlice(src []*uint32) []uint32 {
dst := make([]uint32, len(src))
Expand All @@ -394,8 +394,8 @@ func Uint32ValueSlice(src []*uint32) []uint32 {
return dst
}

// Uint32Map converts a string map of uint32 values uinto a string
// map of uint32 pouinters
// Uint32Map converts a string map of uint32 values into a string
// map of uint32 pointers
func Uint32Map(src map[string]uint32) map[string]*uint32 {
dst := make(map[string]*uint32)
for k, val := range src {
Expand All @@ -405,7 +405,7 @@ func Uint32Map(src map[string]uint32) map[string]*uint32 {
return dst
}

// Uint32ValueMap converts a string map of uint32 pouinters uinto a string
// Uint32ValueMap converts a string map of uint32 pointers into a string
// map of uint32 values
func Uint32ValueMap(src map[string]*uint32) map[string]uint32 {
dst := make(map[string]uint32)
Expand All @@ -417,22 +417,22 @@ func Uint32ValueMap(src map[string]*uint32) map[string]uint32 {
return dst
}

// Uint64 returns a pouinter to of the uint64 value passed in.
// Uint64 returns a pointer to of the uint64 value passed in.
func Uint64(v uint64) *uint64 {
return &v
}

// Uint64Value returns the value of the uint64 pouinter passed in or
// 0 if the pouinter is nil.
// Uint64Value returns the value of the uint64 pointer passed in or
// 0 if the pointer is nil.
func Uint64Value(v *uint64) uint64 {
if v != nil {
return *v
}
return 0
}

// Uint64Slice converts a slice of uint64 values uinto a slice of
// uint64 pouinters
// Uint64Slice converts a slice of uint64 values into a slice of
// uint64 pointers
func Uint64Slice(src []uint64) []*uint64 {
dst := make([]*uint64, len(src))
for i := 0; i < len(src); i++ {
Expand All @@ -441,7 +441,7 @@ func Uint64Slice(src []uint64) []*uint64 {
return dst
}

// Uint64ValueSlice converts a slice of uint64 pouinters uinto a slice of
// Uint64ValueSlice converts a slice of uint64 pointers into a slice of
// uint64 values
func Uint64ValueSlice(src []*uint64) []uint64 {
dst := make([]uint64, len(src))
Expand All @@ -453,8 +453,8 @@ func Uint64ValueSlice(src []*uint64) []uint64 {
return dst
}

// Uint64Map converts a string map of uint64 values uinto a string
// map of uint64 pouinters
// Uint64Map converts a string map of uint64 values into a string
// map of uint64 pointers
func Uint64Map(src map[string]uint64) map[string]*uint64 {
dst := make(map[string]*uint64)
for k, val := range src {
Expand All @@ -464,7 +464,7 @@ func Uint64Map(src map[string]uint64) map[string]*uint64 {
return dst
}

// Uint64ValueMap converts a string map of uint64 pouinters uinto a string
// Uint64ValueMap converts a string map of uint64 pointers into a string
// map of uint64 values
func Uint64ValueMap(src map[string]*uint64) map[string]uint64 {
dst := make(map[string]uint64)
Expand Down
8 changes: 4 additions & 4 deletions json.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type ejUnmarshaler interface {
UnmarshalEasyJSON(w *jlexer.Lexer)
}

// WriteJSON writes json data, prefers finding an appropriate interface to short-circuit the marshaller
// WriteJSON writes json data, prefers finding an appropriate interface to short-circuit the marshaler
// so it takes the fastest option available.
func WriteJSON(data interface{}) ([]byte, error) {
if d, ok := data.(ejMarshaler); ok {
Expand All @@ -65,8 +65,8 @@ func WriteJSON(data interface{}) ([]byte, error) {
return json.Marshal(data)
}

// ReadJSON reads json data, prefers finding an appropriate interface to short-circuit the unmarshaller
// so it takes the fastes option available
// ReadJSON reads json data, prefers finding an appropriate interface to short-circuit the unmarshaler
// so it takes the fastest option available
func ReadJSON(data []byte, value interface{}) error {
trimmedData := bytes.Trim(data, "\x00")
if d, ok := value.(ejUnmarshaler); ok {
Expand Down Expand Up @@ -189,7 +189,7 @@ func FromDynamicJSON(data, target interface{}) error {
return json.Unmarshal(b, target)
}

// NameProvider represents an object capabale of translating from go property names
// NameProvider represents an object capable of translating from go property names
// to json property names
// This type is thread-safe.
type NameProvider struct {
Expand Down

0 comments on commit 6a1eb98

Please sign in to comment.