Change test to use require_NoError instead of explicitly checking err and calling Fatalf throughout all the tests in the file

Improvements to readability
This commit is contained in:
Jean-Noël Moyne
2023-01-26 00:31:17 -08:00
parent e2561a6d54
commit 4fbe13ec1b
3 changed files with 173 additions and 424 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1724,11 +1724,9 @@ func (mset *stream) sourceInfo(si *sourceInfo) *StreamSourceInfo {
return nil
}
var ssi *StreamSourceInfo
var ssi = StreamSourceInfo{Name: si.name, Lag: si.lag, Error: si.err, FilterSubject: si.sf}
if si.tr != nil {
ssi = &StreamSourceInfo{Name: si.name, Lag: si.lag, Error: si.err, FilterSubject: si.sf, SubjectTransform: si.tr.dest}
} else {
ssi = &StreamSourceInfo{Name: si.name, Lag: si.lag, Error: si.err, FilterSubject: si.sf}
ssi.SubjectTransform = si.tr.dest
}
// If we have not heard from the source, set Active to -1.
if si.last.IsZero() {
@@ -1749,7 +1747,7 @@ func (mset *stream) sourceInfo(si *sourceInfo) *StreamSourceInfo {
DeliverPrefix: ext.DeliverPrefix,
}
}
return ssi
return &ssi
}
// Return our source info for our mirror.

View File

@@ -172,8 +172,8 @@ func transformIndexIntArgsHelper(token string, args []string, transformType int1
}
// Helper to ingest and index the subjectTransform destination token (e.g. $x or {{}}) in the token
// returns a transformation type, and three function arguments: an array of source subject token indexes, and a single number (e.g. number of partitions, or a slice size), and a string (e.g.a split delimiter)
// returns a transformation type, and three function arguments: an array of source subject token indexes,
// and a single number (e.g. number of partitions, or a slice size), and a string (e.g.a split delimiter)
func indexPlaceHolders(token string) (int16, []int, int32, string, error) {
length := len(token)
if length > 1 {