File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ func TokenCmd(ch *cmdutil.Helper) *cobra.Command {
4949type ServiceToken struct {
5050 ID string `header:"id" json:"id"`
5151 Name string `header:"name" json:"name"`
52- LastUsedAt * int64 `header:"last_used_at,timestamp(ms|utc|human)" json:"last_used_at"`
52+ LastUsedAt int64 `header:"last_used_at,timestamp(ms|utc|human)" json:"last_used_at"`
5353 CreatedAt int64 `header:"created_at,timestamp(ms|utc|human)" json:"created_at"`
5454
5555 orig * ps.ServiceToken
@@ -67,11 +67,18 @@ func toServiceToken(st *ps.ServiceToken) *ServiceToken {
6767 name = * st .Name
6868 }
6969
70+ // Avoid using GetMillisecondsIfExists as the table printer
71+ // will not order the columns correctly if lastUsedAt is *int64
72+ var lastUsedAt int64
73+ if st .LastUsedAt != nil {
74+ lastUsedAt = printer .GetMilliseconds (* st .LastUsedAt )
75+ }
76+
7077 return & ServiceToken {
7178 ID : st .ID ,
7279 Name : name ,
80+ LastUsedAt : lastUsedAt ,
7381 CreatedAt : printer .GetMilliseconds (st .CreatedAt ),
74- LastUsedAt : printer .GetMillisecondsIfExists (st .LastUsedAt ),
7582 orig : st ,
7683 }
7784}
You can’t perform that action at this time.
0 commit comments