Skip to content

Commit 704bfff

Browse files
committed
cmd+loopd: new cmd/loopd main method replacing the one now in ./loopd
This allows loopd to be used as a library by importing it and calling Start.
1 parent 644b5b1 commit 704bfff

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

cmd/loopd/main.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/lightninglabs/loop/loopd"
7+
)
8+
9+
func main() {
10+
err := loopd.Start()
11+
if err != nil {
12+
fmt.Println(err)
13+
}
14+
}

loopd/main.go renamed to loopd/start.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,7 @@ var (
2626
swapsLock sync.Mutex
2727
)
2828

29-
func main() {
30-
err := start()
31-
if err != nil {
32-
fmt.Println(err)
33-
}
34-
}
35-
36-
func start() error {
29+
func Start() error {
3730
config := defaultConfig
3831

3932
// Parse command line flags.

0 commit comments

Comments
 (0)