mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2026-10-28 10:45:18 +08:00
Supersedes #8582. This follows the same cleanup as open-telemetry/opentelemetry-go-contrib#9268. ## Summary - Remove canonical import path comments from packages, templates, and generated output. - Remove Porto and the vanity-import check/fix targets from the Makefile and CI workflow. - Drop Porto from the tools module now that golangci-lint modernize covers these checks. - Apply the remaining modernize fixes across the repository. - Include the `golang.org/x` dependency updates from #8582. ## Motivation Canonical import path comments are legacy package annotations that conflict with modernize expectations in module-mode repositories. Keeping them also requires a separate Porto-based check and generation rewrite path, which duplicates the existing linting workflow. Updating the templates and generator inputs ensures generated code does not restore the removed annotations.
28 lines
842 B
Go
28 lines
842 B
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package otel
|
|
|
|
// ErrorHandler handles irremediable events.
|
|
type ErrorHandler interface {
|
|
// DO NOT CHANGE: any modification will not be backwards compatible and
|
|
// must never be done outside of a new major release.
|
|
|
|
// Handle handles any error deemed irremediable by an OpenTelemetry
|
|
// component.
|
|
Handle(error)
|
|
// DO NOT CHANGE: any modification will not be backwards compatible and
|
|
// must never be done outside of a new major release.
|
|
}
|
|
|
|
// ErrorHandlerFunc is a convenience adapter to allow the use of a function
|
|
// as an ErrorHandler.
|
|
type ErrorHandlerFunc func(error)
|
|
|
|
var _ ErrorHandler = ErrorHandlerFunc(nil)
|
|
|
|
// Handle handles the irremediable error by calling the ErrorHandlerFunc itself.
|
|
func (f ErrorHandlerFunc) Handle(err error) {
|
|
f(err)
|
|
}
|