(cwd, filename string)
| 80 | } |
| 81 | |
| 82 | func readFile(cwd, filename string) ([]byte, error) { |
| 83 | if len(filename) == 0 { |
| 84 | return nil, errors.New("filename cannot be empty") |
| 85 | } |
| 86 | if filename[0] != '/' { |
| 87 | cwdAbs, err := filepath.Abs(cwd) |
| 88 | if err != nil { |
| 89 | return nil, err |
| 90 | } |
| 91 | dir, _ := filepath.Split(cwdAbs) |
| 92 | filename = filepath.Join(dir, filename) |
| 93 | } |
| 94 | |
| 95 | return ioutil.ReadFile(filename) |
| 96 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…