diff --git a/Makefile b/Makefile index 6e98120222e..487d4abeb04 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,11 @@ $(TOOLS_DIR)/golangci-lint: go.mod go.sum tools.go $(TOOLS_DIR)/misspell: go.mod go.sum tools.go go build -o $(TOOLS_DIR)/misspell github.com/client9/misspell/cmd/misspell -precommit: $(TOOLS_DIR)/golangci-lint $(TOOLS_DIR)/misspell +$(TOOLS_DIR)/stringer: go.mod go.sum tools.go + go build -o $(TOOLS_DIR)/stringer golang.org/x/tools/cmd/stringer + +precommit: $(TOOLS_DIR)/golangci-lint $(TOOLS_DIR)/misspell $(TOOLS_DIR)/stringer + PATH="$(abspath $(TOOLS_DIR)):$${PATH}" go generate ./... $(TOOLS_DIR)/golangci-lint run --fix # TODO: Fix this on windows. $(TOOLS_DIR)/misspell -w $(ALL_DOCS) @@ -29,7 +33,17 @@ test-with-coverage: go tool cover -html=coverage.txt -o coverage.html .PHONY: circle-ci -circle-ci: precommit test-with-coverage test-386 +circle-ci: precommit test-clean-work-tree test-with-coverage test-386 + +.PHONY: test-clean-work-tree +test-clean-work-tree: + @if ! git diff --quiet; then \ + echo; \ + echo "Working tree is not clean"; \ + echo; \ + git status; \ + exit 1; \ + fi .PHONY: test test: @@ -43,4 +57,4 @@ all-pkgs: @echo $(ALL_PKGS) | tr ' ' '\n' | sort all-docs: - @echo $(ALL_DOCS) | tr ' ' '\n' | sort \ No newline at end of file + @echo $(ALL_DOCS) | tr ' ' '\n' | sort diff --git a/experimental/streaming/exporter/observer/eventtype_string.go b/experimental/streaming/exporter/observer/eventtype_string.go index 2cb7fa713ad..35d00d64c17 100644 --- a/experimental/streaming/exporter/observer/eventtype_string.go +++ b/experimental/streaming/exporter/observer/eventtype_string.go @@ -1,17 +1,3 @@ -// 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. - // Code generated by "stringer -type=EventType"; DO NOT EDIT. package observer @@ -32,11 +18,12 @@ func _() { _ = x[NEW_METRIC-7] _ = x[MODIFY_ATTR-8] _ = x[RECORD_STATS-9] + _ = x[SET_STATUS-10] } -const _EventType_name = "INVALIDSTART_SPANFINISH_SPANLOG_EVENTLOGF_EVENTNEW_SCOPENEW_MEASURENEW_METRICMODIFY_ATTRRECORD_STATS" +const _EventType_name = "INVALIDSTART_SPANFINISH_SPANADD_EVENTADD_EVENTFNEW_SCOPENEW_MEASURENEW_METRICMODIFY_ATTRRECORD_STATSSET_STATUS" -var _EventType_index = [...]uint8{0, 7, 17, 28, 37, 47, 56, 67, 77, 88, 100} +var _EventType_index = [...]uint8{0, 7, 17, 28, 37, 47, 56, 67, 77, 88, 100, 110} func (i EventType) String() string { if i < 0 || i >= EventType(len(_EventType_index)-1) { diff --git a/tools.go b/tools.go index 0e4e2518483..6c4e08c445e 100644 --- a/tools.go +++ b/tools.go @@ -5,4 +5,5 @@ package tools import ( _ "github.com/client9/misspell/cmd/misspell" _ "github.com/golangci/golangci-lint/cmd/golangci-lint" + _ "golang.org/x/tools/cmd/stringer" )