@@ -21,7 +21,6 @@ import (
2121 "bufio"
2222 "encoding/json"
2323 "flag"
24- "io/ioutil"
2524 "os"
2625 "path/filepath"
2726 "sort"
@@ -30,7 +29,7 @@ import (
3029
3130 "github.com/stretchr/testify/assert"
3231 "github.com/stretchr/testify/require"
33- "gopkg.in/yaml.v2 "
32+ "gopkg.in/yaml.v3 "
3433
3534 "github.com/elastic/go-libaudit/v2/auparse"
3635)
@@ -110,7 +109,7 @@ func testCoalesceEvent(t *testing.T, file string) {
110109}
111110
112111func readEventsFromYAML (t testing.TB , name string ) []testEvent {
113- file , err := ioutil .ReadFile (name )
112+ file , err := os .ReadFile (name )
114113 if err != nil {
115114 t .Fatal (err )
116115 }
@@ -125,7 +124,7 @@ func readEventsFromYAML(t testing.TB, name string) []testEvent {
125124 t .Fatal ("failed to find 'tests' in yaml" )
126125 }
127126
128- cases , ok := tests .(map [interface {} ]interface {})
127+ cases , ok := tests .(map [string ]interface {})
129128 if ! ok {
130129 t .Fatalf ("unexpected type %T for 'tests'" , tests )
131130 }
@@ -147,7 +146,7 @@ func readEventsFromYAML(t testing.TB, name string) []testEvent {
147146 }
148147
149148 testEvents = append (testEvents , testEvent {
150- name : name .( string ) ,
149+ name : name ,
151150 messages : msgs ,
152151 })
153152 }
@@ -184,7 +183,7 @@ func writeGoldenFile(name string, events []testEventOutput) error {
184183func readGoldenFile (name string ) ([]map [string ]interface {}, error ) {
185184 name = strings .TrimSuffix (name , ".yaml" )
186185
187- data , err := ioutil .ReadFile (name + ".json.golden" )
186+ data , err := os .ReadFile (name + ".json.golden" )
188187 if err != nil {
189188 return nil , err
190189 }
0 commit comments