Skip to content

Commit

Permalink
♻️ refactor: updated codebase #14
Browse files Browse the repository at this point in the history
  • Loading branch information
pnguyen215 committed Sep 23, 2023
1 parent 3e2a0c1 commit a5f4d24
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 60 deletions.
32 changes: 32 additions & 0 deletions pkg/ami/ami_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -683,3 +683,35 @@ func JsonString(data interface{}) string {
}
return string(result)
}

func JsonStringify(data interface{}) string {
s, ok := data.(string)
if ok {
return s
}
result, err := MarshalIndent(data, "", " ")
if err != nil {
return ""
}
return string(result)
}

func MarshalToString(v interface{}) (string, error) {
return _json.MarshalToString(v)
}

func MarshalJsonIterator(v interface{}) ([]byte, error) {
return _json.Marshal(v)
}

func Unmarshal(data []byte, v interface{}) error {
return _json.Unmarshal(data, v)
}

func UnmarshalFromString(str string, v interface{}) error {
return _json.UnmarshalFromString(str, v)
}

func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) {
return _json.MarshalIndent(v, prefix, indent)
}
60 changes: 0 additions & 60 deletions pkg/ami/utils/ami_utils.go

This file was deleted.

0 comments on commit a5f4d24

Please sign in to comment.