|
15 | 15 |
|
16 | 16 | --> |
17 | 17 |
|
18 | | -<h1 align="center">AtomicGo | assert</h1> |
| 18 | +<h1 align="center">AtomicGo | template</h1> |
19 | 19 |
|
20 | 20 | <p align="center"> |
21 | | -<img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fatomicgo.dev%2Fapi%2Fshields%2Fassert&style=flat-square" alt="Downloads"> |
| 21 | +<img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fatomicgo.dev%2Fapi%2Fshields%2Ftemplate&style=flat-square" alt="Downloads"> |
22 | 22 |
|
23 | | -<a href="https://github.com/atomicgo/assert/releases"> |
24 | | -<img src="https://img.shields.io/github/v/release/atomicgo/assert?style=flat-square" alt="Latest Release"> |
| 23 | +<a href="https://github.com/atomicgo/template/releases"> |
| 24 | +<img src="https://img.shields.io/github/v/release/atomicgo/template?style=flat-square" alt="Latest Release"> |
25 | 25 | </a> |
26 | 26 |
|
27 | | -<a href="https://codecov.io/gh/atomicgo/assert" target="_blank"> |
28 | | -<img src="https://img.shields.io/github/actions/workflow/status/atomicgo/assert/go.yml?style=flat-square" alt="Tests"> |
| 27 | +<a href="https://codecov.io/gh/atomicgo/template" target="_blank"> |
| 28 | +<img src="https://img.shields.io/github/actions/workflow/status/atomicgo/template/go.yml?style=flat-square" alt="Tests"> |
29 | 29 | </a> |
30 | 30 |
|
31 | | -<a href="https://codecov.io/gh/atomicgo/assert" target="_blank"> |
32 | | -<img src="https://img.shields.io/codecov/c/gh/atomicgo/assert?color=magenta&logo=codecov&style=flat-square" alt="Coverage"> |
| 31 | +<a href="https://codecov.io/gh/atomicgo/template" target="_blank"> |
| 32 | +<img src="https://img.shields.io/codecov/c/gh/atomicgo/template?color=magenta&logo=codecov&style=flat-square" alt="Coverage"> |
33 | 33 | </a> |
34 | 34 |
|
35 | | -<a href="https://codecov.io/gh/atomicgo/assert"> |
36 | | -<!-- unittestcount:start --><img src="https://img.shields.io/badge/Unit_Tests-162-magenta?style=flat-square" alt="Unit test count"><!-- unittestcount:end --> |
| 35 | +<a href="https://codecov.io/gh/atomicgo/template"> |
| 36 | +<!-- unittestcount:start --><img src="https://img.shields.io/badge/Unit_Tests-3-magenta?style=flat-square" alt="Unit test count"><!-- unittestcount:end --> |
37 | 37 | </a> |
38 | 38 |
|
39 | 39 | <a href="https://opensource.org/licenses/MIT" target="_blank"> |
40 | 40 | <img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square" alt="License: MIT"> |
41 | 41 | </a> |
42 | 42 |
|
43 | | -<a href="https://goreportcard.com/report/github.com/atomicgo/assert" target="_blank"> |
44 | | -<img src="https://goreportcard.com/badge/github.com/atomicgo/assert?style=flat-square" alt="Go report"> |
| 43 | +<a href="https://goreportcard.com/report/github.com/atomicgo/template" target="_blank"> |
| 44 | +<img src="https://goreportcard.com/badge/github.com/atomicgo/template?style=flat-square" alt="Go report"> |
45 | 45 | </a> |
46 | 46 |
|
47 | 47 | </p> |
48 | 48 |
|
49 | 49 | --- |
50 | 50 |
|
51 | 51 | <p align="center"> |
52 | | -<strong><a href="https://pkg.go.dev/atomicgo.dev/assert#section-documentation" target="_blank">Documentation</a></strong> |
| 52 | +<strong><a href="https://pkg.go.dev/atomicgo.dev/template#section-documentation" target="_blank">Documentation</a></strong> |
53 | 53 | | |
54 | 54 | <strong><a href="https://github.com/atomicgo/atomicgo/blob/main/CONTRIBUTING.md" target="_blank">Contributing</a></strong> |
55 | 55 | | |
|
58 | 58 |
|
59 | 59 | --- |
60 | 60 |
|
| 61 | + |
| 62 | + |
61 | 63 | <p align="center"> |
62 | 64 | <img src="https://raw.githubusercontent.com/atomicgo/atomicgo/main/assets/header.png" alt="AtomicGo"> |
63 | 65 | </p> |
|
68 | 70 | </tbody> |
69 | 71 | </table> |
70 | 72 | </p> |
71 | | -<h3 align="center"><pre>go get atomicgo.dev/assert</pre></h3> |
| 73 | +<h3 align="center"><pre>go get atomicgo.dev/template</pre></h3> |
72 | 74 | <p align="center"> |
73 | 75 | <table> |
74 | 76 | <tbody> |
|
80 | 82 |
|
81 | 83 | <!-- Code generated by gomarkdoc. DO NOT EDIT --> |
82 | 84 |
|
83 | | -# assert |
| 85 | +# template |
84 | 86 |
|
85 | 87 | ```go |
86 | | -import "atomicgo.dev/assert" |
| 88 | +import "atomicgo.dev/template" |
87 | 89 | ``` |
88 | 90 |
|
89 | | -Package assert provides a set of assertion functions. Every assertion function returns a boolean. This package does not integrateinto the testing package automatically. If you want to use this package inside unit tests, you have to check the returning boolean value and call \`t.Fatal\(\)\` if the assertion fails. |
| 91 | +Package template is used to generate new AtomicGo repositories. |
90 | 92 |
|
91 | | -This library does not provide any error messages. That way the assertions can also be used in production code. |
| 93 | +Write the description of the module here. You can use \*\*markdown\*\*\! This description should clearly explain what the package does. |
92 | 94 |
|
93 | | -If you want a full\-featured testing framework, we recommend https://github.com/MarvinJWendt/testza \(which uses this library for assertions\) |
| 95 | +Example description: https://golang.org/src/encoding/gob/doc.go |
94 | 96 |
|
95 | | -## Index |
96 | 97 |
|
97 | | -- [func Contains\(a any, b any\) bool](<#Contains>) |
98 | | -- [func ContainsAll\[T any\]\(a T, v \[\]T\) bool](<#ContainsAll>) |
99 | | -- [func ContainsAny\[T any\]\(a T, v \[\]T\) bool](<#ContainsAny>) |
100 | | -- [func ContainsNone\[T any\]\(a T, v \[\]T\) bool](<#ContainsNone>) |
101 | | -- [func Equal\[T any\]\(a, b T\) bool](<#Equal>) |
102 | | -- [func Implements\(a, iface any\) bool](<#Implements>) |
103 | | -- [func Kind\(a any, kind reflect.Kind\) bool](<#Kind>) |
104 | | -- [func Len\(a any, length int\) \(b bool\)](<#Len>) |
105 | | -- [func Lowercase\(s string\) bool](<#Lowercase>) |
106 | | -- [func Nil\(a any\) bool](<#Nil>) |
107 | | -- [func Number\(a any\) bool](<#Number>) |
108 | | -- [func Panic\(f func\(\)\) \(panicked bool\)](<#Panic>) |
109 | | -- [func Range\[T constraints.Number\]\(a, minimum, maximum T\) bool](<#Range>) |
110 | | -- [func Regex\(regex, s string\) bool](<#Regex>) |
111 | | -- [func Unique\[T any\]\(s \[\]T\) bool](<#Unique>) |
112 | | -- [func Uppercase\(s string\) bool](<#Uppercase>) |
113 | | -- [func Zero\(a any\) bool](<#Zero>) |
114 | | - |
115 | | - |
116 | | -<a name="Contains"></a> |
117 | | -## func [Contains](<https://github.com/atomicgo/assert/blob/main/assert.go#L108>) |
118 | 98 |
|
119 | | -```go |
120 | | -func Contains(a any, b any) bool |
121 | | -``` |
122 | | - |
123 | | -Contains returns true if obj contains expectedLen. |
124 | 99 |
|
125 | | -<a name="ContainsAll"></a> |
126 | | -## func [ContainsAll](<https://github.com/atomicgo/assert/blob/main/assert.go#L128>) |
127 | 100 |
|
128 | 101 | ```go |
129 | | -func ContainsAll[T any](a T, v []T) bool |
130 | | -``` |
| 102 | +package main |
131 | 103 |
|
132 | | -ContainsAll returns true if all values are contained in obj. |
| 104 | +import ( |
| 105 | + "fmt" |
133 | 106 |
|
134 | | -<a name="ContainsAny"></a> |
135 | | -## func [ContainsAny](<https://github.com/atomicgo/assert/blob/main/assert.go#L139>) |
| 107 | + "atomicgo.dev/template" |
| 108 | +) |
136 | 109 |
|
137 | | -```go |
138 | | -func ContainsAny[T any](a T, v []T) bool |
139 | | -``` |
140 | | - |
141 | | -ContainsAny returns true if any of the values are contained in obj. |
142 | | - |
143 | | -<a name="ContainsNone"></a> |
144 | | -## func [ContainsNone](<https://github.com/atomicgo/assert/blob/main/assert.go#L150>) |
145 | | - |
146 | | -```go |
147 | | -func ContainsNone[T any](a T, v []T) bool |
| 110 | +func main() { |
| 111 | + fmt.Println(template.HelloWorld()) |
| 112 | +} |
148 | 113 | ``` |
149 | 114 |
|
150 | | -ContainsNone returns true if none of the values are contained in obj. |
| 115 | +#### Output |
151 | 116 |
|
152 | | -<a name="Equal"></a> |
153 | | -## func [Equal](<https://github.com/atomicgo/assert/blob/main/assert.go#L12>) |
154 | | - |
155 | | -```go |
156 | | -func Equal[T any](a, b T) bool |
157 | | -``` |
158 | | - |
159 | | -Equal compares two values and returns true if they are equal. |
160 | | - |
161 | | -<a name="Implements"></a> |
162 | | -## func [Implements](<https://github.com/atomicgo/assert/blob/main/assert.go#L64>) |
163 | | - |
164 | | -```go |
165 | | -func Implements(a, iface any) bool |
166 | | -``` |
167 | | - |
168 | | -Implements returns true if the value implements the interface. |
169 | | - |
170 | | -<a name="Kind"></a> |
171 | | -## func [Kind](<https://github.com/atomicgo/assert/blob/main/assert.go#L17>) |
172 | | - |
173 | | -```go |
174 | | -func Kind(a any, kind reflect.Kind) bool |
175 | 117 | ``` |
176 | | - |
177 | | -Kind returns true if the value is of the given kind. |
178 | | - |
179 | | -<a name="Len"></a> |
180 | | -## func [Len](<https://github.com/atomicgo/assert/blob/main/assert.go#L176>) |
181 | | - |
182 | | -```go |
183 | | -func Len(a any, length int) (b bool) |
| 118 | +Hello, World! |
184 | 119 | ``` |
185 | 120 |
|
186 | | -Len returns true if the length of the value is equal to the given length. |
187 | 121 |
|
188 | | -<a name="Lowercase"></a> |
189 | | -## func [Lowercase](<https://github.com/atomicgo/assert/blob/main/assert.go#L166>) |
190 | | - |
191 | | -```go |
192 | | -func Lowercase(s string) bool |
193 | | -``` |
194 | 122 |
|
195 | | -Lowercase returns true if the string is lowercase. |
196 | | - |
197 | | -<a name="Nil"></a> |
198 | | -## func [Nil](<https://github.com/atomicgo/assert/blob/main/assert.go#L22>) |
| 123 | +## Index |
199 | 124 |
|
200 | | -```go |
201 | | -func Nil(a any) bool |
202 | | -``` |
| 125 | +- [func HelloWorld\(\) string](<#HelloWorld>) |
203 | 126 |
|
204 | | -Nil returns true if the value is nil. |
205 | 127 |
|
206 | | -<a name="Number"></a> |
207 | | -## func [Number](<https://github.com/atomicgo/assert/blob/main/assert.go#L37>) |
| 128 | +<a name="HelloWorld"></a> |
| 129 | +## func [HelloWorld](<https://github.com/atomicgo/template/blob/main/template.go#L4>) |
208 | 130 |
|
209 | 131 | ```go |
210 | | -func Number(a any) bool |
| 132 | +func HelloWorld() string |
211 | 133 | ``` |
212 | 134 |
|
213 | | -Number returns true if the value is obj number. |
| 135 | +HelloWorld returns \`Hello, World\!\`. |
214 | 136 |
|
215 | | -<a name="Panic"></a> |
216 | | -## func [Panic](<https://github.com/atomicgo/assert/blob/main/assert.go#L79>) |
217 | 137 |
|
218 | | -```go |
219 | | -func Panic(f func()) (panicked bool) |
220 | | -``` |
221 | 138 |
|
222 | | -Panic returns true if the function panics. |
223 | 139 |
|
224 | | -<a name="Range"></a> |
225 | | -## func [Range](<https://github.com/atomicgo/assert/blob/main/assert.go#L54>) |
226 | 140 |
|
227 | 141 | ```go |
228 | | -func Range[T constraints.Number](a, minimum, maximum T) bool |
229 | | -``` |
| 142 | +package main |
230 | 143 |
|
231 | | -Range returns true if the value is within the range. |
| 144 | +import ( |
| 145 | + "fmt" |
232 | 146 |
|
233 | | -<a name="Regex"></a> |
234 | | -## func [Regex](<https://github.com/atomicgo/assert/blob/main/assert.go#L171>) |
| 147 | + "atomicgo.dev/template" |
| 148 | +) |
235 | 149 |
|
236 | | -```go |
237 | | -func Regex(regex, s string) bool |
| 150 | +func main() { |
| 151 | + fmt.Println(template.HelloWorld()) |
| 152 | +} |
238 | 153 | ``` |
239 | 154 |
|
240 | | -Regex returns true if the string matches the regex. |
241 | | - |
242 | | -<a name="Unique"></a> |
243 | | -## func [Unique](<https://github.com/atomicgo/assert/blob/main/assert.go#L93>) |
| 155 | +#### Output |
244 | 156 |
|
245 | | -```go |
246 | | -func Unique[T any](s []T) bool |
247 | 157 | ``` |
248 | | - |
249 | | -Unique returns true if the slice contains unique values. Items are considered unique if they are not deep equal. |
250 | | - |
251 | | -<a name="Uppercase"></a> |
252 | | -## func [Uppercase](<https://github.com/atomicgo/assert/blob/main/assert.go#L161>) |
253 | | - |
254 | | -```go |
255 | | -func Uppercase(s string) bool |
| 158 | +Hello, World! |
256 | 159 | ``` |
257 | 160 |
|
258 | | -Uppercase returns true if the string is uppercase. |
259 | | - |
260 | | -<a name="Zero"></a> |
261 | | -## func [Zero](<https://github.com/atomicgo/assert/blob/main/assert.go#L59>) |
262 | | - |
263 | | -```go |
264 | | -func Zero(a any) bool |
265 | | -``` |
266 | 161 |
|
267 | | -Zero returns true if the value is the zero value. |
268 | 162 |
|
269 | 163 | Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>) |
270 | 164 |
|
|
0 commit comments