We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f3f5f5 commit c768e06Copy full SHA for c768e06
README.md
@@ -43,6 +43,41 @@ func main() {
43
fmt.Println(valid)
44
```
45
46
+One Of
47
+```go
48
+package main
49
+
50
+import (
51
+ "fmt"
52
+ "github.com/telkomdev/go-filesig"
53
+ "os"
54
+)
55
56
+func main() {
57
+ args := os.Args
58
59
+ if len(args) < 2 {
60
+ fmt.Println("required input file")
61
+ os.Exit(1)
62
+ }
63
64
+ inputFileArg := args[1]
65
+ inFile, err := os.Open(inputFileArg)
66
67
+ if err != nil {
68
+ fmt.Println("error open input file ", err)
69
70
71
72
+ defer func() { inFile.Close() }()
73
74
+ valid := filesig.IsOneOf(inFile, filesig.Is3gp, filesig.IsPng, filesig.IsJpeg)
75
+ fmt.Println(valid)
76
77
+}
78
79
+```
80
81
HTTP Form File
82
```go
83
package main
0 commit comments