From eeffd758aaaf946f03cdfd9e1decdf4d03cc91b4 Mon Sep 17 00:00:00 2001 From: Volker Schukai <volker.schukai@schukai.com> Date: Sat, 28 Oct 2023 15:10:01 +0200 Subject: [PATCH] fix: update go libs #3 --- .idea/.gitignore | 8 ++++++++ .idea/data.iml | 10 ++++++++++ .idea/markdown.xml | 9 +++++++++ .idea/misc.xml | 6 ++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ go.sum | 11 +++++------ transformer.go | 6 ++++-- util.go | 16 ++++++++-------- 9 files changed, 64 insertions(+), 16 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/data.iml create mode 100644 .idea/markdown.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/data.iml b/.idea/data.iml new file mode 100644 index 0000000..25ed3f6 --- /dev/null +++ b/.idea/data.iml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="JAVA_MODULE" version="4"> + <component name="Go" enabled="true" /> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$" /> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + </component> +</module> \ No newline at end of file diff --git a/.idea/markdown.xml b/.idea/markdown.xml new file mode 100644 index 0000000..ec0b30f --- /dev/null +++ b/.idea/markdown.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="MarkdownSettings"> + <enabledExtensions> + <entry key="MermaidLanguageExtension" value="false" /> + <entry key="PlantUMLLanguageExtension" value="true" /> + </enabledExtensions> + </component> +</project> \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..639900d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectRootManager"> + <output url="file://$PROJECT_DIR$/out" /> + </component> +</project> \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..91a0752 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectModuleManager"> + <modules> + <module fileurl="file://$PROJECT_DIR$/.idea/data.iml" filepath="$PROJECT_DIR$/.idea/data.iml" /> + </modules> + </component> +</project> \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="" vcs="Git" /> + </component> +</project> \ No newline at end of file diff --git a/go.sum b/go.sum index 352876b..ad22fcb 100644 --- a/go.sum +++ b/go.sum @@ -1,16 +1,15 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/volker-schukai/tokenizer v1.0.0 h1:wF4haFoCodq7lgAk8c+th/DZmpFpL2WVD8wDzAGU1mA= github.com/volker-schukai/tokenizer v1.0.0/go.mod h1:LPw7lLIxUnZgeg96818N7IvwLE1x8ya31J/Aa0aCq9M= -gitlab.schukai.com/oss/libraries/go/utilities/pathfinder v0.3.1 h1:oyElaqEiyr2XgaE1CYwD8LoeHsuR/vQD/p6k3jYbJFs= -gitlab.schukai.com/oss/libraries/go/utilities/pathfinder v0.3.1/go.mod h1:UvdD4NAf3gLKYafabJD7e9ZCOetzM9JZ9y4GkZukPVU= -gitlab.schukai.com/oss/libraries/go/utilities/pathfinder v0.4.0 h1:eAEsq3lsHwMe5Zz71vNab5csPtp8S+i5zFPmNnDPFDg= -gitlab.schukai.com/oss/libraries/go/utilities/pathfinder v0.4.0/go.mod h1:UvdD4NAf3gLKYafabJD7e9ZCOetzM9JZ9y4GkZukPVU= -gitlab.schukai.com/oss/libraries/go/utilities/pathfinder v0.8.1 h1:A3KvLvu4rV3OstgEn6xHulhQaXawVvzFzbafYHWHUfs= -gitlab.schukai.com/oss/libraries/go/utilities/pathfinder v0.8.1/go.mod h1:MqCBFv7DXKoBE2rZDc51LGvl2QI7Kz0D+XkQ0izj+ws= gitlab.schukai.com/oss/libraries/go/utilities/pathfinder v0.9.1 h1:WpM6PcFqQZWPBGDEuMILWHq98dPVBLAxi8ae9QMWWbM= gitlab.schukai.com/oss/libraries/go/utilities/pathfinder v0.9.1/go.mod h1:MqCBFv7DXKoBE2rZDc51LGvl2QI7Kz0D+XkQ0izj+ws= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/transformer.go b/transformer.go index 1d430ca..cb9cd82 100644 --- a/transformer.go +++ b/transformer.go @@ -1,8 +1,8 @@ package data import ( - "crypto/md5" - "crypto/sha1" + "crypto/md5" // #nosec + "crypto/sha1" // #nosec "crypto/sha256" "encoding/base64" "encoding/hex" @@ -706,11 +706,13 @@ func handleStrings(tokens TokenList, currentValue string) (any, error) { } else if tokens[0].Is(PipeCmdMD5) { + // #nosec d := md5.Sum([]byte(currentValue)) return hex.EncodeToString(d[:]), nil } else if tokens[0].Is(PipeCmdSHA1) { + // #nosec d := sha1.Sum([]byte(currentValue)) return hex.EncodeToString(d[:]), nil diff --git a/util.go b/util.go index cbcf950..3125485 100644 --- a/util.go +++ b/util.go @@ -45,14 +45,14 @@ func wordWrap(str string, width uint, br string) string { current = 0 } else { current += uint(spacebuf.Len()) - spacebuf.WriteTo(buf) + _, _ = spacebuf.WriteTo(buf) } spacebuf.Reset() } else { current += uint(spacebuf.Len() + wordbuf.Len()) - spacebuf.WriteTo(buf) + _, _ = spacebuf.WriteTo(buf) spacebuf.Reset() - wordbuf.WriteTo(buf) + _, _ = wordbuf.WriteTo(buf) wordbuf.Reset() } buf.WriteRune(char) @@ -60,9 +60,9 @@ func wordWrap(str string, width uint, br string) string { } else if unicode.IsSpace(char) { if spacebuf.Len() == 0 || wordbuf.Len() > 0 { current += uint(spacebuf.Len() + wordbuf.Len()) - spacebuf.WriteTo(buf) + _, _ = spacebuf.WriteTo(buf) spacebuf.Reset() - wordbuf.WriteTo(buf) + _, _ = wordbuf.WriteTo(buf) wordbuf.Reset() } spacebuf.WriteRune(char) @@ -78,11 +78,11 @@ func wordWrap(str string, width uint, br string) string { if wordbuf.Len() == 0 { if current+uint(spacebuf.Len()) <= width { - spacebuf.WriteTo(buf) + _, _ = spacebuf.WriteTo(buf) } } else { - spacebuf.WriteTo(buf) - wordbuf.WriteTo(buf) + _, _ = spacebuf.WriteTo(buf) + _, _ = wordbuf.WriteTo(buf) } return buf.String() } -- GitLab