Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lesiw/fill
Package fill fills Go values with random data.
https://github.com/lesiw/fill
fuzzing go go-lib go-test-helper go-testing golang
Last synced: 2 days ago
JSON representation
Package fill fills Go values with random data.
- Host: GitHub
- URL: https://github.com/lesiw/fill
- Owner: lesiw
- License: mit
- Created: 2024-12-29T02:22:47.000Z (11 days ago)
- Default Branch: main
- Last Pushed: 2024-12-29T03:30:31.000Z (11 days ago)
- Last Synced: 2024-12-29T04:19:18.335Z (10 days ago)
- Topics: fuzzing, go, go-lib, go-test-helper, go-testing, golang
- Language: Go
- Homepage: https://lesiw.io/fill
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lesiw.io/fill
[![Go Reference](https://pkg.go.dev/badge/lesiw.io/fill.svg)](https://pkg.go.dev/lesiw.io/fill)
A utility for filling Go values.
## Example
``` go
package mainimport (
"crypto/tls"
"testing""github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"lesiw.io/fill"
)func TestTlsConfigClone(t *testing.T) {
opts := cmp.Options{cmpopts.IgnoreUnexported(tls.Config{})}
for range 100 {
cfg := new(tls.Config)
fill.Rand(cfg)
if want, got := cfg, cfg.Clone(); !cmp.Equal(want, got, opts) {
t.Fatalf("-original +cloned\n%s", cmp.Diff(want, got, opts))
}
}
}
```[▶️ Run this example on the Go Playground](https://go.dev/play/p/87V0mJqv5qu)