summaryrefslogtreecommitdiff
path: root/storageinfo.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-23 00:20:22 -0500
committerJeff Carr <[email protected]>2024-10-23 00:20:22 -0500
commit2eff11bb2167ea98a4d81996056011eb4fb897d8 (patch)
tree0152afca7994d67ad91d16ae763a8ad0e7c56f7b /storageinfo.go
parent662e3a584971eefdfa6c51fa6decb825941778ba (diff)
notsure
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'storageinfo.go')
-rw-r--r--storageinfo.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/storageinfo.go b/storageinfo.go
index 993f5ef..4e1e9b0 100644
--- a/storageinfo.go
+++ b/storageinfo.go
@@ -14,6 +14,10 @@ func (s StorageInfo) MarshalJSON() ([]byte, error) {
})
}
+func (s StorageInfo) FormatJSON() string {
+ return fmt.Sprintf("\"capacity\": \"%d GB\"", s.Capacity)
+}
+
// UnmarshalJSON custom unmarshals JSON into the StorageInfo struct
func (s *StorageInfo) UnmarshalJSON(data []byte) error {
var raw map[string]string