From 887748491bdda45b09f6c76adbfe396e018cb76e Mon Sep 17 00:00:00 2001 From: Koichi Shiraishi Date: Tue, 27 Aug 2019 01:41:15 +0900 Subject: [PATCH] Add vanity import name (#107) * api: add doc.go and vanity custom import name * experimental/streaming/exporter: add doc.go & vanity custom import name * experimental/streaming/exporter/*: add vanity custom import name * golangci.yml: fix local-prefixes to go.opentelemetry.io * api,sdk: run `goimports -w -local go.opentelemetry.io` --- .golangci.yml | 2 +- api/core/doc.go | 15 +++++++++++++++ api/event/doc.go | 15 +++++++++++++++ api/key/doc.go | 15 +++++++++++++++ api/metric/doc.go | 15 +++++++++++++++ api/registry/doc.go | 15 +++++++++++++++ api/stats/doc.go | 15 +++++++++++++++ api/tag/doc.go | 15 +++++++++++++++ api/trace/always_sampler_test.go | 1 + api/trace/doc.go | 15 +++++++++++++++ api/trace/never_sampler_test.go | 1 + api/unit/doc.go | 15 +++++++++++++++ experimental/streaming/exporter/buffer/doc.go | 15 +++++++++++++++ experimental/streaming/exporter/loader/doc.go | 15 +++++++++++++++ experimental/streaming/exporter/observer/doc.go | 15 +++++++++++++++ experimental/streaming/exporter/reader/doc.go | 15 +++++++++++++++ experimental/streaming/exporter/spandata/doc.go | 15 +++++++++++++++ .../streaming/exporter/spandata/format/doc.go | 15 +++++++++++++++ experimental/streaming/exporter/spanlog/doc.go | 15 +++++++++++++++ .../streaming/exporter/spanlog/install/package.go | 2 +- .../streaming/exporter/spanlog/plugin/package.go | 2 +- .../streaming/exporter/stderr/install/package.go | 2 +- .../streaming/exporter/stderr/plugin/package.go | 2 +- experimental/streaming/exporter/stderr/stderr.go | 2 +- .../streaming/exporter/stdout/install/package.go | 2 +- .../streaming/exporter/stdout/plugin/package.go | 2 +- experimental/streaming/exporter/stdout/stdout.go | 2 +- sdk/trace/export.go | 3 ++- sdk/trace/span.go | 3 ++- sdk/trace/trace_test.go | 3 ++- 30 files changed, 257 insertions(+), 12 deletions(-) create mode 100644 api/core/doc.go create mode 100644 api/event/doc.go create mode 100644 api/key/doc.go create mode 100644 api/metric/doc.go create mode 100644 api/registry/doc.go create mode 100644 api/stats/doc.go create mode 100644 api/tag/doc.go create mode 100644 api/trace/doc.go create mode 100644 api/unit/doc.go create mode 100644 experimental/streaming/exporter/buffer/doc.go create mode 100644 experimental/streaming/exporter/loader/doc.go create mode 100644 experimental/streaming/exporter/observer/doc.go create mode 100644 experimental/streaming/exporter/reader/doc.go create mode 100644 experimental/streaming/exporter/spandata/doc.go create mode 100644 experimental/streaming/exporter/spandata/format/doc.go create mode 100644 experimental/streaming/exporter/spanlog/doc.go diff --git a/.golangci.yml b/.golangci.yml index 09998af3d..11949076e 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -14,4 +14,4 @@ linters-settings: #ignore-words: # - someword goimports: - local-prefixes: github.com/open-telemetry/opentelemetry-go \ No newline at end of file + local-prefixes: go.opentelemetry.io diff --git a/api/core/doc.go b/api/core/doc.go new file mode 100644 index 000000000..c758e06ab --- /dev/null +++ b/api/core/doc.go @@ -0,0 +1,15 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed 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 core // import "go.opentelemetry.io/api/core" diff --git a/api/event/doc.go b/api/event/doc.go new file mode 100644 index 000000000..4e7131bef --- /dev/null +++ b/api/event/doc.go @@ -0,0 +1,15 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed 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 event // import "go.opentelemetry.io/api/event" diff --git a/api/key/doc.go b/api/key/doc.go new file mode 100644 index 000000000..4b3539df2 --- /dev/null +++ b/api/key/doc.go @@ -0,0 +1,15 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed 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 key // import "go.opentelemetry.io/api/key" diff --git a/api/metric/doc.go b/api/metric/doc.go new file mode 100644 index 000000000..4b0b6346f --- /dev/null +++ b/api/metric/doc.go @@ -0,0 +1,15 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed 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 metric // import "go.opentelemetry.io/api/metric" diff --git a/api/registry/doc.go b/api/registry/doc.go new file mode 100644 index 000000000..011326079 --- /dev/null +++ b/api/registry/doc.go @@ -0,0 +1,15 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed 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 registry // import "go.opentelemetry.io/api/registry" diff --git a/api/stats/doc.go b/api/stats/doc.go new file mode 100644 index 000000000..81f0ad0ed --- /dev/null +++ b/api/stats/doc.go @@ -0,0 +1,15 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed 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 stats // import "go.opentelemetry.io/api/stats" diff --git a/api/tag/doc.go b/api/tag/doc.go new file mode 100644 index 000000000..62f127a17 --- /dev/null +++ b/api/tag/doc.go @@ -0,0 +1,15 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed 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 tag // import "go.opentelemetry.io/api/tag" diff --git a/api/trace/always_sampler_test.go b/api/trace/always_sampler_test.go index e9fc7ee27..c41b552d9 100644 --- a/api/trace/always_sampler_test.go +++ b/api/trace/always_sampler_test.go @@ -18,6 +18,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" + "go.opentelemetry.io/api/core" ) diff --git a/api/trace/doc.go b/api/trace/doc.go new file mode 100644 index 000000000..30c745c11 --- /dev/null +++ b/api/trace/doc.go @@ -0,0 +1,15 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed 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 trace // import "go.opentelemetry.io/api/trace" diff --git a/api/trace/never_sampler_test.go b/api/trace/never_sampler_test.go index 3f1e7598f..6c8c4a7b3 100644 --- a/api/trace/never_sampler_test.go +++ b/api/trace/never_sampler_test.go @@ -18,6 +18,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" + "go.opentelemetry.io/api/core" ) diff --git a/api/unit/doc.go b/api/unit/doc.go new file mode 100644 index 000000000..8eb9bcf3d --- /dev/null +++ b/api/unit/doc.go @@ -0,0 +1,15 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed 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 unit // import "go.opentelemetry.io/api/unit" diff --git a/experimental/streaming/exporter/buffer/doc.go b/experimental/streaming/exporter/buffer/doc.go new file mode 100644 index 000000000..163e34b08 --- /dev/null +++ b/experimental/streaming/exporter/buffer/doc.go @@ -0,0 +1,15 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed 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 buffer // import "go.opentelemetry.io/experimental/streaming/exporter/buffer" diff --git a/experimental/streaming/exporter/loader/doc.go b/experimental/streaming/exporter/loader/doc.go new file mode 100644 index 000000000..281d8cd16 --- /dev/null +++ b/experimental/streaming/exporter/loader/doc.go @@ -0,0 +1,15 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed 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 loader // import "go.opentelemetry.io/experimental/streaming/exporter/loader" diff --git a/experimental/streaming/exporter/observer/doc.go b/experimental/streaming/exporter/observer/doc.go new file mode 100644 index 000000000..1cec1ad3f --- /dev/null +++ b/experimental/streaming/exporter/observer/doc.go @@ -0,0 +1,15 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed 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 observer // import "go.opentelemetry.io/experimental/streaming/exporter/observer" diff --git a/experimental/streaming/exporter/reader/doc.go b/experimental/streaming/exporter/reader/doc.go new file mode 100644 index 000000000..a112b2ec6 --- /dev/null +++ b/experimental/streaming/exporter/reader/doc.go @@ -0,0 +1,15 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed 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 reader // import "go.opentelemetry.io/experimental/streaming/exporter/reader" diff --git a/experimental/streaming/exporter/spandata/doc.go b/experimental/streaming/exporter/spandata/doc.go new file mode 100644 index 000000000..4238a8924 --- /dev/null +++ b/experimental/streaming/exporter/spandata/doc.go @@ -0,0 +1,15 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed 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 spandata // import "go.opentelemetry.io/experimental/streaming/exporter/spandata" diff --git a/experimental/streaming/exporter/spandata/format/doc.go b/experimental/streaming/exporter/spandata/format/doc.go new file mode 100644 index 000000000..acf11aea0 --- /dev/null +++ b/experimental/streaming/exporter/spandata/format/doc.go @@ -0,0 +1,15 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed 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 format // import "go.opentelemetry.io/experimental/streaming/exporter/spandata/format" diff --git a/experimental/streaming/exporter/spanlog/doc.go b/experimental/streaming/exporter/spanlog/doc.go new file mode 100644 index 000000000..96e6e7735 --- /dev/null +++ b/experimental/streaming/exporter/spanlog/doc.go @@ -0,0 +1,15 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed 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 spanlog // import "go.opentelemetry.io/experimental/streaming/exporter/spanlog" diff --git a/experimental/streaming/exporter/spanlog/install/package.go b/experimental/streaming/exporter/spanlog/install/package.go index c70b29be0..f7f9621cd 100644 --- a/experimental/streaming/exporter/spanlog/install/package.go +++ b/experimental/streaming/exporter/spanlog/install/package.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package install +package install // import "go.opentelemetry.io/experimental/streaming/exporter/spanlog/install" import ( "go.opentelemetry.io/experimental/streaming/exporter/observer" diff --git a/experimental/streaming/exporter/spanlog/plugin/package.go b/experimental/streaming/exporter/spanlog/plugin/package.go index 13bb3e07f..4b71ca215 100644 --- a/experimental/streaming/exporter/spanlog/plugin/package.go +++ b/experimental/streaming/exporter/spanlog/plugin/package.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package main +package main // import "go.opentelemetry.io/experimental/streaming/exporter/spanlog/plugin" import ( "go.opentelemetry.io/experimental/streaming/exporter/observer" diff --git a/experimental/streaming/exporter/stderr/install/package.go b/experimental/streaming/exporter/stderr/install/package.go index 4c04fd346..7039a6c86 100644 --- a/experimental/streaming/exporter/stderr/install/package.go +++ b/experimental/streaming/exporter/stderr/install/package.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package install +package install // import "go.opentelemetry.io/experimental/streaming/exporter/stderr/install" import ( "go.opentelemetry.io/experimental/streaming/exporter/observer" diff --git a/experimental/streaming/exporter/stderr/plugin/package.go b/experimental/streaming/exporter/stderr/plugin/package.go index 649a6b7b0..52d3eb3c0 100644 --- a/experimental/streaming/exporter/stderr/plugin/package.go +++ b/experimental/streaming/exporter/stderr/plugin/package.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package main +package main // "go.opentelemetry.io/experimental/streaming/exporter/stderr/plugin" import ( "go.opentelemetry.io/experimental/streaming/exporter/observer" diff --git a/experimental/streaming/exporter/stderr/stderr.go b/experimental/streaming/exporter/stderr/stderr.go index bd8ffa2f6..9d7a3b18a 100644 --- a/experimental/streaming/exporter/stderr/stderr.go +++ b/experimental/streaming/exporter/stderr/stderr.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package stderr +package stderr // import "go.opentelemetry.io/experimental/streaming/exporter/stderr" import ( "os" diff --git a/experimental/streaming/exporter/stdout/install/package.go b/experimental/streaming/exporter/stdout/install/package.go index b2b9bd69b..b4b294f37 100644 --- a/experimental/streaming/exporter/stdout/install/package.go +++ b/experimental/streaming/exporter/stdout/install/package.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package install +package install // import "go.opentelemetry.io/experimental/streaming/exporter/stdout/install" import ( "go.opentelemetry.io/experimental/streaming/exporter/observer" diff --git a/experimental/streaming/exporter/stdout/plugin/package.go b/experimental/streaming/exporter/stdout/plugin/package.go index ba09e8972..b398c1007 100644 --- a/experimental/streaming/exporter/stdout/plugin/package.go +++ b/experimental/streaming/exporter/stdout/plugin/package.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package main +package main // import "go.opentelemetry.io/experimental/streaming/exporter/stdout/plugin" import ( "go.opentelemetry.io/experimental/streaming/exporter/observer" diff --git a/experimental/streaming/exporter/stdout/stdout.go b/experimental/streaming/exporter/stdout/stdout.go index c1caf80aa..0c587b63b 100644 --- a/experimental/streaming/exporter/stdout/stdout.go +++ b/experimental/streaming/exporter/stdout/stdout.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package stdout +package stdout // import "go.opentelemetry.io/experimental/streaming/exporter/stdout" import ( "os" diff --git a/sdk/trace/export.go b/sdk/trace/export.go index 52292dc46..cacacb098 100644 --- a/sdk/trace/export.go +++ b/sdk/trace/export.go @@ -19,8 +19,9 @@ import ( "sync/atomic" "time" - "go.opentelemetry.io/api/core" "google.golang.org/grpc/codes" + + "go.opentelemetry.io/api/core" ) // Exporter is a type for functions that receive sampled trace spans. diff --git a/sdk/trace/span.go b/sdk/trace/span.go index fa0b50bec..5ad85081c 100644 --- a/sdk/trace/span.go +++ b/sdk/trace/span.go @@ -19,12 +19,13 @@ import ( "sync" "time" + "google.golang.org/grpc/codes" + "go.opentelemetry.io/api/core" apievent "go.opentelemetry.io/api/event" apitag "go.opentelemetry.io/api/tag" apitrace "go.opentelemetry.io/api/trace" "go.opentelemetry.io/sdk/internal" - "google.golang.org/grpc/codes" ) // span implements apitrace.Span interface. diff --git a/sdk/trace/trace_test.go b/sdk/trace/trace_test.go index 7c84a6b25..ce6997001 100644 --- a/sdk/trace/trace_test.go +++ b/sdk/trace/trace_test.go @@ -22,10 +22,11 @@ import ( "time" "github.com/google/go-cmp/cmp" + "google.golang.org/grpc/codes" + "go.opentelemetry.io/api/core" "go.opentelemetry.io/api/key" apitrace "go.opentelemetry.io/api/trace" - "google.golang.org/grpc/codes" ) var (