-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfile.go
More file actions
35 lines (31 loc) · 918 Bytes
/
file.go
File metadata and controls
35 lines (31 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package gofaker
// FileExtension will generate a random file extension
func FileExtension() string {
return getRandValue([]string{"file", "extension"})
}
// FileMimeType will generate a random mime file type
func FileMimeType() string {
return getRandValue([]string{"file", "mime_type"})
}
func addFileLookup() {
AddFuncLookup("fileextension", Info{
Display: "File Extension",
Category: "file",
Description: "Random file extension",
Example: "nes",
Output: "string",
Call: func(m *map[string][]string, info *Info) (interface{}, error) {
return FileExtension(), nil
},
})
AddFuncLookup("filemimetype", Info{
Display: "File Mime Type",
Category: "file",
Description: "Random file mime type",
Example: "application/json",
Output: "string",
Call: func(m *map[string][]string, info *Info) (interface{}, error) {
return FileMimeType(), nil
},
})
}