Просмотр исходного кода

Fix error when no responses file is given

Lu Stadler лет назад: 7
Родитель
Сommit
0b91d78f9f
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      go/fake-http/fake-http.go

+ 3 - 0
go/fake-http/fake-http.go

329
329
330
// Load loads responses from the YAML file at path.
330
// Load loads responses from the YAML file at path.
331
func (rs *Responses) Load(path string) {
331
func (rs *Responses) Load(path string) {
332
	if path == "" {
333
		return
334
	}
332
	responses, err := rs.loadFile(path)
335
	responses, err := rs.loadFile(path)
333
	if err != nil {
336
	if err != nil {
334
		log.Printf("Error: Parsing %s: %s", path, err)
337
		log.Printf("Error: Parsing %s: %s", path, err)