From b3e6a8d0ab22a4b9b589c8e10dcfc9e64e62e698 Mon Sep 17 00:00:00 2001 From: fearful-symmetry Date: Wed, 17 Jul 2024 08:58:59 -0700 Subject: [PATCH] format --- internal/registry/registry.go | 8 ++++---- providers/linux/host_linux.go | 1 - providers/linux/machineid_test.go | 17 +++++++++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/internal/registry/registry.go b/internal/registry/registry.go index 8f9aae7..00a9d2c 100644 --- a/internal/registry/registry.go +++ b/internal/registry/registry.go @@ -23,8 +23,10 @@ import ( "github.com/elastic/go-sysinfo/types" ) -type HostOptsCreator = func(ProviderOptions) HostProvider -type ProcessOptsCreator = func(ProviderOptions) ProcessProvider +type ( + HostOptsCreator = func(ProviderOptions) HostProvider + ProcessOptsCreator = func(ProviderOptions) ProcessProvider +) // HostProvider defines interfaces that provide host-specific metrics type HostProvider interface { @@ -78,7 +80,6 @@ func Register(provider interface{}) { } processProvider = p } - } // GetHostProvider returns the HostProvider registered for the system. May return nil. @@ -87,7 +88,6 @@ func GetHostProvider(opts ProviderOptions) HostProvider { return hostProviderWithOpts(opts) } return hostProvider - } // GetProcessProvider returns the ProcessProvider registered on the system. May return nil. diff --git a/providers/linux/host_linux.go b/providers/linux/host_linux.go index ecaed70..3a09f63 100644 --- a/providers/linux/host_linux.go +++ b/providers/linux/host_linux.go @@ -37,7 +37,6 @@ func init() { // register wrappers that implement the HostFS versions of the ProcessProvider and HostProvider registry.Register(func(opts registry.ProviderOptions) registry.HostProvider { return newLinuxSystem(opts.Hostfs) }) registry.Register(func(opts registry.ProviderOptions) registry.ProcessProvider { return newLinuxSystem(opts.Hostfs) }) - } type linuxSystem struct { diff --git a/providers/linux/machineid_test.go b/providers/linux/machineid_test.go index 0706497..3dee6ec 100644 --- a/providers/linux/machineid_test.go +++ b/providers/linux/machineid_test.go @@ -1,3 +1,20 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + package linux import (