File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -32,24 +32,15 @@ var ListCmd = base.ListCmd[*hcloud.StorageBox, schema.StorageBox]{
3232 }).
3333 AddFieldFn ("username" , func (obj any ) string {
3434 storageBox := obj .(* hcloud.StorageBox )
35- if storageBox .Username == nil {
36- return "-"
37- }
38- return * storageBox .Username
35+ return util .OptionalString (storageBox .Username , "-" )
3936 }).
4037 AddFieldFn ("server" , func (obj any ) string {
4138 storageBox := obj .(* hcloud.StorageBox )
42- if storageBox .Server == nil {
43- return "-"
44- }
45- return * storageBox .Server
39+ return util .OptionalString (storageBox .Server , "-" )
4640 }).
4741 AddFieldFn ("system" , func (obj any ) string {
4842 storageBox := obj .(* hcloud.StorageBox )
49- if storageBox .System == nil {
50- return "-"
51- }
52- return * storageBox .System
43+ return util .OptionalString (storageBox .System , "-" )
5344 }).
5445 AddFieldFn ("location" , func (obj any ) string {
5546 storageBox := obj .(* hcloud.StorageBox )
You can’t perform that action at this time.
0 commit comments