Skip to content

Commit 2480c56

Browse files
feat: no longer require branch to have more than one end nodes (#263)
1 parent 837f2f7 commit 2480c56

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

compose/graph.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -454,10 +454,6 @@ func (g *graph) addBranch(startNode string, branch *GraphBranch, skipData bool)
454454
return fmt.Errorf("branch start node '%s' needs to be added to graph first", startNode)
455455
}
456456

457-
if len(branch.endNodes) == 1 {
458-
return fmt.Errorf("number of branches is 1")
459-
}
460-
461457
if _, ok := g.handlerPreBranch[startNode]; !ok {
462458
g.handlerPreBranch[startNode] = [][]handlerPair{}
463459
}

internal/concat.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ func RegisterStreamChunkConcatFunc[T any](fn func([]T) (T, error)) {
7272
concatFuncs[generic.TypeOf[T]()] = fn
7373
}
7474

75-
func GetConcatFunc(tpe reflect.Type) func(reflect.Value) (reflect.Value, error) {
76-
if fn, ok := concatFuncs[tpe]; ok {
75+
func GetConcatFunc(typ reflect.Type) func(reflect.Value) (reflect.Value, error) {
76+
if fn, ok := concatFuncs[typ]; ok {
7777
return func(a reflect.Value) (reflect.Value, error) {
7878
rvs := reflect.ValueOf(fn).Call([]reflect.Value{a})
7979
var err error

0 commit comments

Comments
 (0)