Skip to content

Commit

Permalink
update codegen
Browse files Browse the repository at this point in the history
Signed-off-by: cpanato <ctadeu@gmail.com>
  • Loading branch information
cpanato committed May 21, 2022
1 parent 8c02532 commit a91afef
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 1.4.0 (January 5, 2021)
# 1.4.0 (January 5, 2022)

FEATURES:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Versioning Library for Go
[![Build Status](https://circleci.com/gh/hashicorp/go-version/tree/master.svg?style=svg)](https://circleci.com/gh/hashicorp/go-version/tree/master)
[![Build Status](https://circleci.com/gh/hashicorp/go-version/tree/main.svg?style=svg)](https://circleci.com/gh/hashicorp/go-version/tree/main)
[![GoDoc](https://godoc.org/github.com/hashicorp/go-version?status.svg)](https://godoc.org/github.com/hashicorp/go-version)

go-version is a library for parsing versions and version constraints,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,3 +388,20 @@ func (v *Version) String() string {
func (v *Version) Original() string {
return v.original
}

// UnmarshalText implements encoding.TextUnmarshaler interface.
func (v *Version) UnmarshalText(b []byte) error {
temp, err := NewVersion(string(b))
if err != nil {
return err
}

*v = *temp

return nil
}

// MarshalText implements encoding.TextMarshaler interface.
func (v *Version) MarshalText() ([]byte, error) {
return []byte(v.String()), nil
}

0 comments on commit a91afef

Please sign in to comment.