Skip to content

Commit 6f215c5

Browse files
committed
Updated
1 parent 87998ee commit 6f215c5

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

pkg/types/mime.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package types
22

3-
import "mime"
3+
import (
4+
"mime"
5+
)
46

57
///////////////////////////////////////////////////////////////////////////////
68
// GLOBALS
@@ -13,6 +15,7 @@ const (
1315
ContentTypeCSV = "text/csv"
1416
ContentTypeTextXml = "text/xml"
1517
ContentTypeTextPlain = "text/plain"
18+
ContentTypeFormData = "multipart/form-data"
1619
ContentTypeAny = "*/*"
1720
)
1821

pkg/types/ptr.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ func PtrUint64(v *uint64) uint64 {
3333
return *v
3434
}
3535

36+
// Int64Ptr returns a pointer to a int64
37+
func Int64Ptr(v int64) *int64 {
38+
return &v
39+
}
40+
3641
// PtrInt64 returns a int64 from a pointer
3742
func PtrInt64(v *int64) int64 {
3843
if v == nil {

pkg/types/string.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package types
22

33
import (
4+
"strconv"
45
"strings"
56
"unicode"
67
)
@@ -53,3 +54,12 @@ func IsUppercase(s string) bool {
5354
}
5455
return true
5556
}
57+
58+
// Unquote returns a string with the input string unquoted
59+
func Unquote(s string) string {
60+
if str, err := strconv.Unquote(s); err == nil {
61+
return str
62+
} else {
63+
return s
64+
}
65+
}

0 commit comments

Comments
 (0)