From 590cbafae9b2c9c03b9a084f18e5f4bece7af7fb Mon Sep 17 00:00:00 2001 From: wit liu <765765346@qq.com> Date: Sun, 21 Sep 2025 18:57:54 +0800 Subject: [PATCH] all: fix goimports (#1521) Co-authored-by: wit --- console/console_test.go | 1 - contracts/XDCx/simulation/price/main.go | 4 ++-- contracts/trc21issuer/simulation/deploy/main.go | 7 ++++--- p2p/nat/nat.go | 14 +++++++------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/console/console_test.go b/console/console_test.go index 69588bbb20..4dc74fde27 100644 --- a/console/console_test.go +++ b/console/console_test.go @@ -26,7 +26,6 @@ import ( "github.com/XinFinOrg/XDPoSChain/XDCx" "github.com/XinFinOrg/XDPoSChain/XDCxlending" - "github.com/XinFinOrg/XDPoSChain/common" "github.com/XinFinOrg/XDPoSChain/core" "github.com/XinFinOrg/XDPoSChain/eth" diff --git a/contracts/XDCx/simulation/price/main.go b/contracts/XDCx/simulation/price/main.go index 36c4bec06d..cb9383d0ed 100644 --- a/contracts/XDCx/simulation/price/main.go +++ b/contracts/XDCx/simulation/price/main.go @@ -3,15 +3,15 @@ package main import ( "context" "fmt" - "github.com/XinFinOrg/XDPoSChain/XDCxlending/lendingstate" - "github.com/XinFinOrg/XDPoSChain/core/state" "math/big" "os" "time" + "github.com/XinFinOrg/XDPoSChain/XDCxlending/lendingstate" "github.com/XinFinOrg/XDPoSChain/accounts/abi/bind" "github.com/XinFinOrg/XDPoSChain/common" "github.com/XinFinOrg/XDPoSChain/contracts/XDCx" + "github.com/XinFinOrg/XDPoSChain/core/state" "github.com/XinFinOrg/XDPoSChain/crypto" "github.com/XinFinOrg/XDPoSChain/ethclient" ) diff --git a/contracts/trc21issuer/simulation/deploy/main.go b/contracts/trc21issuer/simulation/deploy/main.go index 15cc304279..814c4cd755 100644 --- a/contracts/trc21issuer/simulation/deploy/main.go +++ b/contracts/trc21issuer/simulation/deploy/main.go @@ -3,14 +3,15 @@ package main import ( "context" "fmt" + "log" + "math/big" + "time" + "github.com/XinFinOrg/XDPoSChain/accounts/abi/bind" "github.com/XinFinOrg/XDPoSChain/common" "github.com/XinFinOrg/XDPoSChain/contracts/trc21issuer" "github.com/XinFinOrg/XDPoSChain/contracts/trc21issuer/simulation" "github.com/XinFinOrg/XDPoSChain/ethclient" - "log" - "math/big" - "time" ) func main() { diff --git a/p2p/nat/nat.go b/p2p/nat/nat.go index d8c996bfe5..1ee4edf155 100644 --- a/p2p/nat/nat.go +++ b/p2p/nat/nat.go @@ -26,7 +26,7 @@ import ( "time" "github.com/XinFinOrg/XDPoSChain/log" - "github.com/jackpal/go-nat-pmp" + natpmp "github.com/jackpal/go-nat-pmp" ) // An implementation of nat.Interface can map local ports to ports @@ -53,12 +53,12 @@ type Interface interface { // The following formats are currently accepted. // Note that mechanism names are not case-sensitive. // -// "" or "none" return nil -// "extip:77.12.33.4" will assume the local machine is reachable on the given IP -// "any" uses the first auto-detected mechanism -// "upnp" uses the Universal Plug and Play protocol -// "pmp" uses NAT-PMP with an auto-detected gateway address -// "pmp:192.168.0.1" uses NAT-PMP with the given gateway address +// "" or "none" return nil +// "extip:77.12.33.4" will assume the local machine is reachable on the given IP +// "any" uses the first auto-detected mechanism +// "upnp" uses the Universal Plug and Play protocol +// "pmp" uses NAT-PMP with an auto-detected gateway address +// "pmp:192.168.0.1" uses NAT-PMP with the given gateway address func Parse(spec string) (Interface, error) { var ( before, after, found = strings.Cut(spec, ":")