gitlab.com/evatix-go/core@v1.3.55/errcore/RangeNotMeet.go (about)

     1  package errcore
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"gitlab.com/evatix-go/core/constants"
     7  )
     8  
     9  func RangeNotMeet(
    10  	otherMsg string,
    11  	rangeStart interface{},
    12  	rangeEnd interface{},
    13  	wholeRange interface{},
    14  ) string {
    15  	rangeStr := ""
    16  
    17  	if wholeRange == nil {
    18  		rangeStr = fmt.Sprintf(rangeWithoutRangeFormat, rangeStart, rangeEnd)
    19  	} else {
    20  		rangeStr = fmt.Sprintf(rangeWithRangeFormat, rangeStart, rangeEnd, wholeRange)
    21  	}
    22  
    23  	return OutOfRangeType.String() +
    24  		constants.Space +
    25  		otherMsg +
    26  		ReferenceStart +
    27  		rangeStr +
    28  		ReferenceEnd
    29  }