Files
Paulo JanottiandGitHub 25e633e04d [chore] Fix lint for GOOS=windows (on Windows and other OSes) (#13625)
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.
2025-08-21 09:39:34 +00:00

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
}
}