candiduslynx commented on code in PR #35457:
URL: https://github.com/apache/arrow/pull/35457#discussion_r1187747529


##########
go/arrow/datatype_fixedwidth.go:
##########
@@ -325,6 +325,22 @@ func (u TimeUnit) Multiplier() time.Duration {
 
 func (u TimeUnit) String() string { return [...]string{"s", "ms", "us", 
"ns"}[uint(u)&3] }
 
+var _strToTimeUnit = map[string]TimeUnit{
+       "s":  Second,
+       "ms": Millisecond,
+       "us": Microsecond,
+       "ns": Nanosecond,
+}
+
+// TimeUnitFromString is the reverse of TimeUnit.String
+func TimeUnitFromString(s string) (TimeUnit, error) {
+       if v, ok := _strToTimeUnit[s]; ok {
+               return v, nil
+       }
+
+       return 0, fmt.Errorf("unsupported time unit: %q", s)
+}

Review Comment:
   Not used anymore.
   I'll remove this in a minute



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to