shogo/internal/utils/read.go
perp 07c61c1b1c 🎉 Beginning
First push for beginning of project
2023-08-01 23:35:47 +01:00

21 lines
324 B
Go

package utils
import "os"
// Return the API key
func getKey() (string, error) {
// Get config directory
config, err := os.UserConfigDir()
if err != nil {
return "", err
}
// Read the file
content, err := os.ReadFile(config + "/shodan/api_key")
if err != nil {
return "", err
}
return string(content), nil
}