Use external main module
* renames main package so it's importable * adds wrapmain sub-module as main module
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package main
|
||||
package geth
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package main
|
||||
package geth
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package main
|
||||
package geth
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package main
|
||||
package geth
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package main
|
||||
package geth
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package main
|
||||
package geth
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package main
|
||||
package geth
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package main
|
||||
package geth
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package main
|
||||
package geth
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package main
|
||||
package geth
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package main
|
||||
package geth
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package main
|
||||
package geth
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
+5
-2
@@ -15,7 +15,7 @@
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// geth is the official command-line client for Ethereum.
|
||||
package main
|
||||
package geth
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -267,7 +267,10 @@ func init() {
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
// FIXME workaround https://github.com/golang/go/issues/31354 by wrapping main
|
||||
func main() { Main() }
|
||||
|
||||
func Main() {
|
||||
if err := app.Run(os.Args); err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package main
|
||||
package geth
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package geth
|
||||
|
||||
import (
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
@@ -105,18 +105,18 @@ func pluginsOnShutdown() {
|
||||
|
||||
func BlockChain(pl *plugins.PluginLoader) {
|
||||
fnList := pl.Lookup("BlockChain", func(item interface{}) bool {
|
||||
_, ok := item.(func())
|
||||
return ok
|
||||
_, ok := item.(func())
|
||||
return ok
|
||||
})
|
||||
for _, fni := range fnList {
|
||||
fni.(func())()
|
||||
fni.(func())()
|
||||
}
|
||||
}
|
||||
|
||||
func pluginBlockChain() {
|
||||
if plugins.DefaultPluginLoader == nil {
|
||||
log.Warn("Attempting BlockChain, but default PluginLoader has not been initialized")
|
||||
return
|
||||
log.Warn("Attempting BlockChain, but default PluginLoader has not been initialized")
|
||||
return
|
||||
}
|
||||
BlockChain(plugins.DefaultPluginLoader)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package main
|
||||
package geth
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package main
|
||||
package geth
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package main
|
||||
package geth
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package main
|
||||
package geth
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package main
|
||||
package geth
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
Reference in New Issue
Block a user