From 79933615f7988cb731baa0768a45b39008f18b20 Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Fri, 7 Jul 2017 11:30:47 +0200 Subject: add first test --- pkg/rtree/main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pkg/rtree/main.go') diff --git a/pkg/rtree/main.go b/pkg/rtree/main.go index f08126e..762f457 100644 --- a/pkg/rtree/main.go +++ b/pkg/rtree/main.go @@ -24,8 +24,11 @@ import ( "github.com/majewsky/gofu/pkg/cli" ) -//Exec executes the rtree applet and does not return. The argument is os.Args -//minus the leading "rtree" or "gofu rtree". +//Exec executes the rtree applet and returns an exit code (0 for success, >0 +//for error). The argument is os.Args minus the leading "rtree" or "gofu +//rtree". All side-effects (reading from stdin, writing to stdout/stderr, +//executing other programs) pass through cli.Interface and can be intercepted +//there for the purpose of testing. func Exec(args []string) int { if !Init() { return 1 -- cgit v1.3.1