From e55661075b52dc697ae98e5890f35d7e213476ba Mon Sep 17 00:00:00 2001 From: piglig Date: Sun, 24 Dec 2023 18:02:18 +0800 Subject: [PATCH] refactor: the generative way of svg of demo --- example/main.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/example/main.go b/example/main.go index ac26aef..b3ebfb4 100644 --- a/example/main.go +++ b/example/main.go @@ -5,7 +5,6 @@ import ( "fmt" go_qr "github.com/piglig/go-qr" "image/color" - "os" "strings" ) @@ -29,17 +28,7 @@ func doBasicDemo() { return } - svg, err := toSvgString(qr, 4, "#FFFFFF", "#000000") - if err != nil { - return - } - - svgFile, err := os.Create("hello-world-QR.svg") - if err != nil { - return - } - defer svgFile.Close() - _, err = svgFile.WriteString(svg) + err = qr.SVG(config, "hello-world-QR.svg", "#FFFFFF", "#000000") if err != nil { return }