@@ -8,14 +8,14 @@ import (
88 "errors"
99 "flag"
1010 "fmt"
11- "io/ioutil "
11+ "io"
1212 "os"
1313 "strings"
1414
1515 "github.com/hashicorp/hcl/v2"
1616 "github.com/hashicorp/hcl/v2/hclparse"
1717 "github.com/hashicorp/hcl/v2/hclwrite"
18- "golang.org/x/crypto/ssh/terminal "
18+ "golang.org/x/term "
1919)
2020
2121const versionStr = "0.0.1-dev"
@@ -33,8 +33,8 @@ var checkErrs = false
3333var changed []string
3434
3535func init () {
36- color := terminal .IsTerminal (int (os .Stderr .Fd ()))
37- w , _ , err := terminal .GetSize (int (os .Stdout .Fd ()))
36+ color := term .IsTerminal (int (os .Stderr .Fd ()))
37+ w , _ , err := term .GetSize (int (os .Stdout .Fd ()))
3838 if err != nil {
3939 w = 80
4040 }
@@ -109,15 +109,15 @@ func processFiles() error {
109109
110110func processFile (fn string , in * os.File ) error {
111111 var err error
112- var hasLocalChanges bool = false
112+ hasLocalChanges : = false
113113 if in == nil {
114114 in , err = os .Open (fn )
115115 if err != nil {
116116 return fmt .Errorf ("failed to open %s: %s" , fn , err )
117117 }
118118 }
119119
120- inSrc , err := ioutil .ReadAll (in )
120+ inSrc , err := io .ReadAll (in )
121121 if err != nil {
122122 return fmt .Errorf ("failed to read %s: %s" , fn , err )
123123 }
@@ -140,7 +140,7 @@ func processFile(fn string, in *os.File) error {
140140
141141 if * overwrite {
142142 if hasLocalChanges {
143- return ioutil .WriteFile (fn , outSrc , 0644 )
143+ return os .WriteFile (fn , outSrc , 0644 )
144144 } else {
145145 return nil
146146 }
0 commit comments