Open Ellwould opened 2 years ago
Original Code:
func main() { //Read the secret token from file system data, err := ioutil.ReadFile("dummy_secret.pem") check(err) secret := string(data) otp := getTOTPToken(secret)
New Code:
func main() { //Read the secret token from file system data, err := os.ReadFile("dummy_secret.pem") check(err) secret := string(data) otp := getTOTPToken(secret)
OR
func main() { //Read the secret token from file system secret, err := os.ReadFile("dummy_secret.pem") check(err) otp := getTOTPToken(string(secret))
import package os and remove package io/ioutil
Source: https://pkg.go.dev/io/ioutil@go1.19.3
Original Code:
func main() { //Read the secret token from file system data, err := ioutil.ReadFile("dummy_secret.pem") check(err) secret := string(data) otp := getTOTPToken(secret)
New Code:
func main() { //Read the secret token from file system data, err := os.ReadFile("dummy_secret.pem") check(err) secret := string(data) otp := getTOTPToken(secret)
OR
func main() { //Read the secret token from file system secret, err := os.ReadFile("dummy_secret.pem") check(err) otp := getTOTPToken(string(secret))
import package os and remove package io/ioutil
Source: https://pkg.go.dev/io/ioutil@go1.19.3