2020-11-09 20:27:03 +00:00
package testdata
import (
"crypto/rand"
"fmt"
"math/big"
osAlias "os"
"path/filepath"
)
2021-04-23 12:06:05 +00:00
// UseAliasedPackages --
2020-11-09 20:27:03 +00:00
func UseAliasedPackages ( ) {
randPath , _ := rand . Int ( rand . Reader , big . NewInt ( 1000000 ) )
p := filepath . Join ( tempDir ( ) , fmt . Sprintf ( "/%d" , randPath ) )
2021-09-17 21:55:24 +00:00
_ = osAlias . MkdirAll ( p , osAlias . ModePerm ) // want "os and ioutil dir and file writing functions are not permissions-safe, use shared/file"
2020-11-09 20:27:03 +00:00
someFile := filepath . Join ( p , "some.txt" )
2022-04-18 20:42:07 +00:00
_ = osAlias . WriteFile ( someFile , [ ] byte ( "hello" ) , osAlias . ModePerm ) // want "os and ioutil dir and file writing functions are not permissions-safe, use shared/file"
2020-11-09 20:27:03 +00:00
}