Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'workhorse/internal/utils/svg/README.md')
-rw-r--r--workhorse/internal/utils/svg/README.md45
1 files changed, 45 insertions, 0 deletions
diff --git a/workhorse/internal/utils/svg/README.md b/workhorse/internal/utils/svg/README.md
new file mode 100644
index 00000000000..e5531f47473
--- /dev/null
+++ b/workhorse/internal/utils/svg/README.md
@@ -0,0 +1,45 @@
+# go-is-svg
+
+Tiny package to verify if a given file buffer is an SVG image in Go (golang).
+
+## Installation
+
+```bash
+go get -u github.com/h2non/go-is-svg
+```
+
+## Example
+
+```go
+package main
+
+import (
+ "fmt"
+ "io/ioutil"
+
+ svg "github.com/h2non/go-is-svg"
+)
+
+func main() {
+ buf, err := ioutil.ReadFile("_example/example.svg")
+ if err != nil {
+ fmt.Printf("Error: %s\n", err)
+ return
+ }
+
+ if svg.Is(buf) {
+ fmt.Println("File is an SVG")
+ } else {
+ fmt.Println("File is NOT an SVG")
+ }
+}
+```
+
+Run example:
+```bash
+go run _example/example.go
+```
+
+## License
+
+MIT - Tomas Aparicio