mirror of
https://github.com/hanzoai/telemetry.git
synced 2026-10-30 20:01:49 +00:00
Fix lint target when `GOOS=windows` and ensure that is possible to run `make lint` from other OSes. This is part of the work to release the collector for Windows ARM, tracked via https://github.com/open-telemetry/opentelemetry-collector-releases/issues/412 The golang sources were changed for it to pass lint when `GOOS=windows`, I will look into adding that to CI so it doesn't regress again.
24 lines
548 B
Go
24 lines
548 B
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
//go:build windows
|
|
|
|
package configtls // import "go.opentelemetry.io/collector/config/configtls"
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/google/go-tpm/tpm2/transport"
|
|
"github.com/google/go-tpm/tpmutil"
|
|
)
|
|
|
|
func openTPM(_ string) func() (transport.TPMCloser, error) {
|
|
return func() (transport.TPMCloser, error) {
|
|
tpm, err := tpmutil.OpenTPM()
|
|
if err != nil {
|
|
return nil, fmt.Errorf("failed to open TPM: %w", err)
|
|
}
|
|
return transport.FromReadWriteCloser(tpm), nil
|
|
}
|
|
}
|