readfile.go 234 B

1234567891011121314151617
  1. package conf
  2. import (
  3. "errors"
  4. "fmt"
  5. "os"
  6. )
  7. func ReadMasterIp() (string, error) {
  8. _url, err := os.ReadFile("url")
  9. if err != nil {
  10. fmt.Println(err)
  11. return "", errors.New("读取文件失败")
  12. }
  13. return string(_url), nil
  14. }