From 0b92dbb8463dee31c005c59f67c2bf754a9eae12 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sun, 22 May 2022 21:29:35 +0700 Subject: all: export and rename the hostsBlock type to Blockd In the Environment, we have a field HostsBlocks that reference an unexported type hostsFile. In order for any package to be able to use this field, we need to export this type. While at it, we rename the type from hostsBlock to Blockd to make it simple and consistent with name. --- environment_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'environment_test.go') diff --git a/environment_test.go b/environment_test.go index 4c3393e..99d0950 100644 --- a/environment_test.go +++ b/environment_test.go @@ -73,16 +73,16 @@ func TestLoadEnvironment(t *testing.T) { fileConfig: filepath.Join(testDirBase, "/etc/rescached/rescached.cfg"), WUIListen: "127.0.0.1:5381", - HostsBlocks: map[string]*hostsBlock{ - "pgl.yoyo.org": &hostsBlock{ + HostBlockd: map[string]*Blockd{ + "pgl.yoyo.org": &Blockd{ Name: "pgl.yoyo.org", URL: `http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&startdate[day]=&startdate[month]=&startdate[year]=&mimetype=plaintext`, }, - "winhelp2002.mvps.org": &hostsBlock{ + "winhelp2002.mvps.org": &Blockd{ Name: "winhelp2002.mvps.org", URL: `http://winhelp2002.mvps.org/hosts.txt`, }, - "someonewhocares.org": &hostsBlock{ + "someonewhocares.org": &Blockd{ Name: "someonewhocares.org", URL: `http://someonewhocares.org/hosts/hosts`, }, @@ -120,7 +120,7 @@ func TestLoadEnvironment(t *testing.T) { test.Assert(t, "LoadEnvironment", expEnv, gotEnv) - gotEnv.HostsBlocks["test"] = &hostsBlock{ + gotEnv.HostBlockd["test"] = &Blockd{ Name: "test", URL: "http://someurl", } -- cgit v1.3