Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultTolerance = 0.0001
DefaultTolerance 상수는 float 값을 비교할 때 사용하는 기본 tolerance 값입니다
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JsonMatcher ¶
type JsonMatcher struct { ResultString string Result bool // contains filtered or unexported fields }
func (JsonMatcher) Eq ¶
func (m JsonMatcher) Eq(target string, value interface{}, tolerance float64) JsonMatcher
Eq 함수는 앞서 Json(jsonString)으로 생성한 Json string에 대해서 전달된 target으로 프로퍼티를 찾아 전달된 value 값과 비교합니다. 이때 부동소수점 비교할 때 두 값의 차이가 tolerance 값보다 작은 경우 같다고 판단합니다. 이 값을 고르기 힘들다면 DefaultTolerance 상수를 사용해도 됩니다
Click to show internal directories.
Click to hide internal directories.