From 2444445706d7bc5b6679f50cbc17497ae5c74101 Mon Sep 17 00:00:00 2001 From: David Muir Sharnoff Date: Sun, 25 Sep 2022 11:37:51 -0700 Subject: [PATCH] add .gitattributes --- .gitattributes | 18 ++++++++++++++++++ Makefile | 9 +++++++-- line.go | 1 + line.zzzgo | 4 ---- 4 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..5eb84b0f --- /dev/null +++ b/.gitattributes @@ -0,0 +1,18 @@ +*.zzzgo linguist-language=Go +doc.go linguist-documentation +*.md linguist-documentation +basegroup.go linguist-generated +line.go linguist-generated +seed.go linguist-generated +span.go linguist-generated +sub.go linguist-generated +internal/enumer_test.go linguist-generated +trace/hexbytes.go linguist-generated +xopat/attributes.go linguist-generated +xopbase/base.go linguist-generated +xopjson/attributes.go linguist-generated +xopjson/jsonlogger.go linguist-generated +xopotel/otel.go linguist-generated +xoptest/testlogger.go linguist-generated +xoputil/skip.go linguist-generated +xoptest/xoptestutil/enums.go linguist-generated diff --git a/Makefile b/Makefile index c2832725..5dc924ba 100644 --- a/Makefile +++ b/Makefile @@ -8,10 +8,16 @@ ZZZGENERATED = $(patsubst %.zzzgo, %.go, $(ZZZGO)) TOOLS = ${GOBIN}/gofumpt ${GOBIN}/goimports ${GOBIN}/enumer TEST_ONLY =? -all: $(ZZZGENERATED) +all: $(ZZZGENERATED) .gitattributes go generate ./... go build ./... +.gitattributes: $(ZZZGENERATED) + echo '*.zzzgo linguist-language=Go' > $@ + echo 'doc.go linguist-documentation' >> $@ + echo '*.md linguist-documentation' >> $@ + for i in $(ZZZGENERATED); do echo "$$i linguist-generated" >> $@; done + test: $(ZZZGENERATED) testadjuster go generate ./... go test -v ./xopjson/... -run TestASingleLine @@ -87,4 +93,3 @@ OTEL_TAG="v1.12.0" otel-generate: ../opentelemetry-specification ../opentelemetry-go cd ../opentelemetry-specification && git pull && git checkout tags/$(OTEL_TAG) - diff --git a/line.go b/line.go index bd94818f..945516fe 100644 --- a/line.go +++ b/line.go @@ -45,6 +45,7 @@ func (line *Line) Any(k string, v interface{}) *Line { return line } if line.log.span.referencesKept { + // TODO: make copy function configurable v = deepcopy.Copy(v) } line.line.Any(k, v) diff --git a/line.zzzgo b/line.zzzgo index ac1cdaa4..f298ad9a 100644 --- a/line.zzzgo +++ b/line.zzzgo @@ -46,10 +46,6 @@ func (line *Line) Any(k string, v interface{}) *Line { return line } -// TODO: func (l *Log) Guage(name string, value float64, ) -// TODO: func (l *Log) AdjustCounter(name string, value float64, ) -// TODO: func (l *Log) Event - func (line *Line) Float32(k string, v float32) *Line { line.line.Float64(k, float64(v), xopbase.Float32DataType) return line