github.com/getgauge/gauge@v1.6.9/gauge/buildErrors.go (about)

     1  /*----------------------------------------------------------------
     2   *  Copyright (c) ThoughtWorks, Inc.
     3   *  Licensed under the Apache License, Version 2.0
     4   *  See LICENSE in the project root for license information.
     5   *----------------------------------------------------------------*/
     6  
     7  package gauge
     8  
     9  type BuildErrors struct {
    10  	SpecErrs     map[*Specification][]error
    11  	ScenarioErrs map[*Scenario][]error
    12  	StepErrs     map[*Step]error
    13  }
    14  
    15  func (e *BuildErrors) HasErrors() bool {
    16  	return (len(e.SpecErrs) + len(e.ScenarioErrs) + len(e.StepErrs)) > 0
    17  }
    18  
    19  func NewBuildErrors() *BuildErrors {
    20  	return &BuildErrors{
    21  		SpecErrs:     make(map[*Specification][]error),
    22  		ScenarioErrs: make(map[*Scenario][]error),
    23  		StepErrs:     make(map[*Step]error),
    24  	}
    25  }