From f8f2b8db06cbf05d5a4f826393833a96e27076e4 Mon Sep 17 00:00:00 2001 From: Tristan Morgan Date: Fri, 8 Sep 2023 09:41:14 +1000 Subject: [PATCH] Remove deprecated ioutil. --- config.go | 3 +-- main_test.go | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/config.go b/config.go index 18c407f..bf322ac 100644 --- a/config.go +++ b/config.go @@ -6,7 +6,6 @@ package main import ( "fmt" "io" - "io/ioutil" "os" "reflect" "strings" @@ -245,7 +244,7 @@ var configDecodeHook = mapstructure.ComposeDecodeHookFunc( // configuration struct func DecodeConfig(r io.Reader) (*HumanConfig, error) { // Parse the file (could be HCL or JSON) - bytes, err := ioutil.ReadAll(r) + bytes, err := io.ReadAll(r) if err != nil { return nil, err } diff --git a/main_test.go b/main_test.go index 0cc85c2..f30bf8e 100644 --- a/main_test.go +++ b/main_test.go @@ -5,8 +5,8 @@ package main import ( "fmt" - "io/ioutil" "log" + "io" "os" "reflect" "strings" @@ -18,7 +18,7 @@ import ( ) // Change as needed to see log/consul-agent output -var output = ioutil.Discard +var output = io.Discard var LOGOUT = output var STDOUT = output var STDERR = output