aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--example.go3
-rw-r--r--gorankusu_test.go2
-rw-r--r--internal/cmd/gorankusu/main.go8
3 files changed, 9 insertions, 4 deletions
diff --git a/example.go b/example.go
index 3a72fbf..f32847b 100644
--- a/example.go
+++ b/example.go
@@ -60,10 +60,11 @@ type Example struct {
}
// NewExample create, initialize, and setup an example of Gorankusu.
-func NewExample() (ex *Example, err error) {
+func NewExample(listenAddress string) (ex *Example, err error) {
var logp = `NewExample`
var env = &Environment{
+ ListenAddress: listenAddress,
ResultsDir: `testdata/example/`,
ResultsSuffix: `example`,
}
diff --git a/gorankusu_test.go b/gorankusu_test.go
index 3ff5f9e..9435acc 100644
--- a/gorankusu_test.go
+++ b/gorankusu_test.go
@@ -24,7 +24,7 @@ func TestMain(m *testing.M) {
// Mock crypto [rand.Reader] for predictable HTTP boundary.
rand.Reader = mock.NewRandReader([]byte(`gorankusu`))
- exGorankusu, err = NewExample()
+ exGorankusu, err = NewExample(``)
if err != nil {
log.Fatal(err)
}
diff --git a/internal/cmd/gorankusu/main.go b/internal/cmd/gorankusu/main.go
index 63386bf..f14e432 100644
--- a/internal/cmd/gorankusu/main.go
+++ b/internal/cmd/gorankusu/main.go
@@ -40,9 +40,13 @@ func main() {
mlog.Fatalf(`%s`, err)
}
- var ex *gorankusu.Example
+ var (
+ listenAddress = `127.0.0.1:18217`
+
+ ex *gorankusu.Example
+ )
- ex, err = gorankusu.NewExample()
+ ex, err = gorankusu.NewExample(listenAddress)
if err != nil {
mlog.Fatalf(`%s`, err)
}