forked from Plemya-x/ALR
		
	chore: remove code duplication
This commit is contained in:
		@@ -11,7 +11,7 @@
 | 
				
			|||||||
    <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
 | 
					    <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
 | 
				
			||||||
        <text x="33.5" y="15" fill="#010101" fill-opacity=".3">coverage</text>
 | 
					        <text x="33.5" y="15" fill="#010101" fill-opacity=".3">coverage</text>
 | 
				
			||||||
        <text x="33.5" y="14">coverage</text>
 | 
					        <text x="33.5" y="14">coverage</text>
 | 
				
			||||||
        <text x="86" y="15" fill="#010101" fill-opacity=".3">18.2%</text>
 | 
					        <text x="86" y="15" fill="#010101" fill-opacity=".3">18.3%</text>
 | 
				
			||||||
        <text x="86" y="14">18.2%</text>
 | 
					        <text x="86" y="14">18.3%</text>
 | 
				
			||||||
    </g>
 | 
					    </g>
 | 
				
			||||||
</svg>
 | 
					</svg>
 | 
				
			||||||
 
 | 
				
			|||||||
| 
		 Before Width: | Height: | Size: 926 B After Width: | Height: | Size: 926 B  | 
@@ -169,21 +169,7 @@ type ScriptFunc func(ctx context.Context, opts ...interp.RunnerOption) error
 | 
				
			|||||||
// GetFunc returns a function corresponding to a bash function
 | 
					// GetFunc returns a function corresponding to a bash function
 | 
				
			||||||
// with the given name
 | 
					// with the given name
 | 
				
			||||||
func (d *Decoder) GetFunc(name string) (ScriptFunc, bool) {
 | 
					func (d *Decoder) GetFunc(name string) (ScriptFunc, bool) {
 | 
				
			||||||
	fn := d.getFunc(name)
 | 
						return d.GetFuncP(name, nil)
 | 
				
			||||||
	if fn == nil {
 | 
					 | 
				
			||||||
		return nil, false
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	return func(ctx context.Context, opts ...interp.RunnerOption) error {
 | 
					 | 
				
			||||||
		sub := d.Runner.Subshell()
 | 
					 | 
				
			||||||
		for _, opt := range opts {
 | 
					 | 
				
			||||||
			err := opt(sub)
 | 
					 | 
				
			||||||
			if err != nil {
 | 
					 | 
				
			||||||
				return err
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		return sub.Run(ctx, fn)
 | 
					 | 
				
			||||||
	}, true
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type PrepareFunc func(context.Context, *interp.Runner) error
 | 
					type PrepareFunc func(context.Context, *interp.Runner) error
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user