chore: replace use of deprecated ioutil with os

This commit is contained in:
Nicholas Jackson
2023-09-21 17:03:30 -07:00
committed by quobix
parent d4dabca04f
commit b6f5730a7f
10 changed files with 69 additions and 63 deletions

View File

@@ -5,7 +5,7 @@ package datamodel
import (
"fmt"
"io/ioutil"
"os"
"testing"
"github.com/pb33f/libopenapi/utils"
@@ -290,7 +290,7 @@ func TestExtractSpecInfo_BadVersion_AsyncAPI(t *testing.T) {
func ExampleExtractSpecInfo() {
// load bytes from openapi spec file.
bytes, _ := ioutil.ReadFile("../test_specs/petstorev3.json")
bytes, _ := os.ReadFile("../test_specs/petstorev3.json")
// create a new *SpecInfo instance from loaded bytes
specInfo, err := ExtractSpecInfo(bytes)