From 633049f185ee5df120cd2e4276f0339b9d52cfac Mon Sep 17 00:00:00 2001 From: aoright <102943475+aoright@users.noreply.github.com> Date: Thu, 20 Aug 2026 13:56:55 +0800 Subject: [PATCH] test: add TestVersion and fix doc comment grammar Signed-off-by: aoright <102943475+aoright@users.noreply.github.com> --- doc.go | 4 ++-- version_test.go | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 version_test.go diff --git a/doc.go b/doc.go index 77b01d04..ede31d4f 100644 --- a/doc.go +++ b/doc.go @@ -137,7 +137,7 @@ // changing the function to accept that struct instead. This is referred to as // a parameter object. // -// Dig has first class support for parameter objects: any struct embedding +// Dig has first-class support for parameter objects: any struct embedding // dig.In gets treated as a parameter object. The following is equivalent to // the constructor above. // @@ -192,7 +192,7 @@ // Dig supports declaring dependencies as optional by adding an // `optional:"true"` tag to fields of a dig.In struct. // -// Fields in a dig.In structs that have the `optional:"true"` tag are treated +// Fields in a dig.In struct that have the `optional:"true"` tag are treated // as optional by Dig. // // type UserGatewayParams struct { diff --git a/version_test.go b/version_test.go new file mode 100644 index 00000000..355fd2c2 --- /dev/null +++ b/version_test.go @@ -0,0 +1,32 @@ +// Copyright (c) 2026 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package dig_test + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "go.uber.org/dig" +) + +func TestVersion(t *testing.T) { + assert.NotEmpty(t, dig.Version) +}