From 601d8ecebb1fa92b54a5ea869f5b05f38a76e308 Mon Sep 17 00:00:00 2001 From: Mark Rosemaker <48681726+MarkRosemaker@users.noreply.github.com> Date: Sun, 29 May 2022 12:33:51 +0200 Subject: [PATCH] simplify UnmarshalText --- version.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/version.go b/version.go index 55f09a1..baecfcd 100644 --- a/version.go +++ b/version.go @@ -443,12 +443,9 @@ func (v *Version) UnmarshalText(text []byte) error { if err != nil { return err } - v.major = temp.major - v.minor = temp.minor - v.patch = temp.patch - v.pre = temp.pre - v.metadata = temp.metadata - v.original = temp.original + + *v = *temp + return nil }