Skip to content

Commit f7f5a2f

Browse files
authored
Merge pull request #89 from ramisback/dependency_upgrade
deps: upgraded dependency
2 parents a60dd5b + a5e347c commit f7f5a2f

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

go.mod

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module github.com/ua-parser/uap-go
22

3+
go 1.22.11
4+
35
require (
4-
github.com/hashicorp/golang-lru v0.5.4
5-
gopkg.in/yaml.v2 v2.2.1
6+
github.com/hashicorp/golang-lru v1.0.2
7+
gopkg.in/yaml.v3 v3.0.1
68
)

go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
2-
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
1+
github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c=
2+
github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
33
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
44
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
5-
gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
6-
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
5+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
6+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

uaparser/parser.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ package uaparser
22

33
import (
44
"fmt"
5-
"io/ioutil"
5+
"os"
66
"regexp"
77
"sort"
88
"sync"
99
"sync/atomic"
1010
"time"
1111

12-
"gopkg.in/yaml.v2"
12+
"gopkg.in/yaml.v3"
1313
)
1414

1515
type RegexesDefinitions struct {
@@ -190,7 +190,7 @@ func defaultParserConfig() *parserConfig {
190190
}
191191

192192
func NewWithOptions(regexFile string, mode, treshold, topCnt int, useSort, debugMode bool, cacheSize int) (*Parser, error) {
193-
data, err := ioutil.ReadFile(regexFile)
193+
data, err := os.ReadFile(regexFile)
194194
if nil != err {
195195
return nil, err
196196
}
@@ -222,7 +222,7 @@ func NewWithOptions(regexFile string, mode, treshold, topCnt int, useSort, debug
222222
}
223223

224224
func New(regexFile string) (*Parser, error) {
225-
data, err := ioutil.ReadFile(regexFile)
225+
data, err := os.ReadFile(regexFile)
226226
if nil != err {
227227
return nil, err
228228
}
@@ -292,7 +292,7 @@ func (parser *Parser) Parse(line string) *Client {
292292
}()
293293
}
294294
wg.Wait()
295-
if parser.config.UseSort == true {
295+
if parser.config.UseSort {
296296
checkAndSort(parser)
297297
}
298298
return cli

uaparser/parsing_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package uaparser
22

33
import (
4-
"io/ioutil"
54
"log"
5+
"os"
66
"testing"
77

8-
"gopkg.in/yaml.v2"
8+
"gopkg.in/yaml.v3"
99
)
1010

1111
var testParser *Parser
@@ -107,7 +107,7 @@ func TestGenericParseMethodConcurrency(t *testing.T) { // go test -race -run=Con
107107
}
108108

109109
func unmarshalResourceTestFile(filepath string, v interface{}) {
110-
file, err := ioutil.ReadFile(filepath)
110+
file, err := os.ReadFile(filepath)
111111
if nil != err {
112112
log.Fatal(err)
113113
}

0 commit comments

Comments
 (0)