21 lines
324 B
Go
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
|
||
|
}
|