Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions dsd/dsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func Dump(t interface{}, format uint8) ([]byte, error) {

// DumpIndent stores the interface as a dsd formatted data structure with indentation, if available.
func DumpIndent(t interface{}, format uint8, indent string) ([]byte, error) {
data, err := dumpWithoutIdentifier(t, format, indent)
data, err := DumpWithoutIdentifier(t, format, indent)
if err != nil {
return nil, err
}
Expand All @@ -102,7 +102,8 @@ func DumpIndent(t interface{}, format uint8, indent string) ([]byte, error) {
return append(varint.Pack8(format), data...), nil
}

func dumpWithoutIdentifier(t interface{}, format uint8, indent string) ([]byte, error) {
// DumpWithoutIdentifier stores the interface as a data structure, without format identifier, but with indentation, if specified and available.
func DumpWithoutIdentifier(t interface{}, format uint8, indent string) ([]byte, error) {
format, ok := ValidateSerializationFormat(format)
if !ok {
return nil, ErrIncompatibleFormat
Expand Down
4 changes: 2 additions & 2 deletions dsd/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func DumpToHTTPRequest(r *http.Request, t interface{}, format uint8) error {
}

// Serialize data.
data, err := dumpWithoutIdentifier(t, format, "")
data, err := DumpWithoutIdentifier(t, format, "")
if err != nil {
return fmt.Errorf("dsd: failed to serialize: %w", err)
}
Expand Down Expand Up @@ -117,7 +117,7 @@ func MimeDump(t any, accept string) (data []byte, mimeType string, format uint8,
}

// Serialize and return.
data, err = dumpWithoutIdentifier(t, format, "")
data, err = DumpWithoutIdentifier(t, format, "")
return data, mimeType, format, err
}

Expand Down