pkg.re/essentialkaos/ek.10@v12.41.0+incompatible/timeutil/fuzz.go (about) 1 //go:build gofuzz 2 // +build gofuzz 3 4 package timeutil 5 6 // ////////////////////////////////////////////////////////////////////////////////// // 7 // // 8 // Copyright (c) 2022 ESSENTIAL KAOS // 9 // Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> // 10 // // 11 // ////////////////////////////////////////////////////////////////////////////////// // 12 13 import ( 14 "time" 15 ) 16 17 // ////////////////////////////////////////////////////////////////////////////////// // 18 19 var fuzzTestDate = time.Now() 20 21 // ////////////////////////////////////////////////////////////////////////////////// // 22 23 func Fuzz(data []byte) int { 24 f := Format(fuzzTestDate, string(data)) 25 26 if f != "" { 27 return 0 28 } 29 30 return 1 31 }