Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
43df6122
Unverified
Commit
43df6122
authored
Sep 13, 2023
by
Martin Holst Swende
Committed by
GitHub
Sep 13, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
internal, log: remove code for old unsupported go-versions (#28090)
parent
766272ff
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
114 deletions
+19
-114
loudpanic.go
internal/debug/loudpanic.go
+0
-3
loudpanic_fallback.go
internal/debug/loudpanic_fallback.go
+0
-25
trace.go
internal/debug/trace.go
+0
-3
trace_fallback.go
internal/debug/trace_fallback.go
+0
-32
handler.go
log/handler.go
+19
-0
handler_go13.go
log/handler_go13.go
+0
-27
handler_go14.go
log/handler_go14.go
+0
-24
No files found.
internal/debug/loudpanic.go
View file @
43df6122
...
@@ -14,9 +14,6 @@
...
@@ -14,9 +14,6 @@
// You should have received a copy of the GNU Lesser General Public License
// 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/>.
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
//go:build go1.6
// +build go1.6
package
debug
package
debug
import
"runtime/debug"
import
"runtime/debug"
...
...
internal/debug/loudpanic_fallback.go
deleted
100644 → 0
View file @
766272ff
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// 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/>.
//go:build !go1.6
// +build !go1.6
package
debug
// LoudPanic panics in a way that gets all goroutine stacks printed on stderr.
func
LoudPanic
(
x
interface
{})
{
panic
(
x
)
}
internal/debug/trace.go
View file @
43df6122
...
@@ -14,9 +14,6 @@
...
@@ -14,9 +14,6 @@
// You should have received a copy of the GNU Lesser General Public License
// 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/>.
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
//go:build go1.5
// +build go1.5
package
debug
package
debug
import
(
import
(
...
...
internal/debug/trace_fallback.go
deleted
100644 → 0
View file @
766272ff
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// 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/>.
//go:build !go1.5
// +build !go1.5
// no-op implementation of tracing methods for Go < 1.5.
package
debug
import
"errors"
func
(
*
HandlerT
)
StartGoTrace
(
string
)
error
{
return
errors
.
New
(
"tracing is not supported on Go < 1.5"
)
}
func
(
*
HandlerT
)
StopGoTrace
()
error
{
return
errors
.
New
(
"tracing is not supported on Go < 1.5"
)
}
log/handler.go
View file @
43df6122
...
@@ -7,6 +7,7 @@ import (
...
@@ -7,6 +7,7 @@ import (
"os"
"os"
"reflect"
"reflect"
"sync"
"sync"
"sync/atomic"
"github.com/go-stack/stack"
"github.com/go-stack/stack"
)
)
...
@@ -354,3 +355,21 @@ func (m muster) FileHandler(path string, fmtr Format) Handler {
...
@@ -354,3 +355,21 @@ func (m muster) FileHandler(path string, fmtr Format) Handler {
func
(
m
muster
)
NetHandler
(
network
,
addr
string
,
fmtr
Format
)
Handler
{
func
(
m
muster
)
NetHandler
(
network
,
addr
string
,
fmtr
Format
)
Handler
{
return
must
(
NetHandler
(
network
,
addr
,
fmtr
))
return
must
(
NetHandler
(
network
,
addr
,
fmtr
))
}
}
// swapHandler wraps another handler that may be swapped out
// dynamically at runtime in a thread-safe fashion.
type
swapHandler
struct
{
handler
atomic
.
Value
}
func
(
h
*
swapHandler
)
Log
(
r
*
Record
)
error
{
return
(
*
h
.
handler
.
Load
()
.
(
*
Handler
))
.
Log
(
r
)
}
func
(
h
*
swapHandler
)
Swap
(
newHandler
Handler
)
{
h
.
handler
.
Store
(
&
newHandler
)
}
func
(
h
*
swapHandler
)
Get
()
Handler
{
return
*
h
.
handler
.
Load
()
.
(
*
Handler
)
}
log/handler_go13.go
deleted
100644 → 0
View file @
766272ff
//go:build !go1.4
// +build !go1.4
package
log
import
(
"sync/atomic"
"unsafe"
)
// swapHandler wraps another handler that may be swapped out
// dynamically at runtime in a thread-safe fashion.
type
swapHandler
struct
{
handler
unsafe
.
Pointer
}
func
(
h
*
swapHandler
)
Log
(
r
*
Record
)
error
{
return
h
.
Get
()
.
Log
(
r
)
}
func
(
h
*
swapHandler
)
Get
()
Handler
{
return
*
(
*
Handler
)(
atomic
.
LoadPointer
(
&
h
.
handler
))
}
func
(
h
*
swapHandler
)
Swap
(
newHandler
Handler
)
{
atomic
.
StorePointer
(
&
h
.
handler
,
unsafe
.
Pointer
(
&
newHandler
))
}
log/handler_go14.go
deleted
100644 → 0
View file @
766272ff
//go:build go1.4
// +build go1.4
package
log
import
"sync/atomic"
// swapHandler wraps another handler that may be swapped out
// dynamically at runtime in a thread-safe fashion.
type
swapHandler
struct
{
handler
atomic
.
Value
}
func
(
h
*
swapHandler
)
Log
(
r
*
Record
)
error
{
return
(
*
h
.
handler
.
Load
()
.
(
*
Handler
))
.
Log
(
r
)
}
func
(
h
*
swapHandler
)
Swap
(
newHandler
Handler
)
{
h
.
handler
.
Store
(
&
newHandler
)
}
func
(
h
*
swapHandler
)
Get
()
Handler
{
return
*
h
.
handler
.
Load
()
.
(
*
Handler
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment