From 8305d85e219bff923921f8f2cca9014b9a6d8024 Mon Sep 17 00:00:00 2001 From: Ali OYGUR Date: Fri, 8 Jan 2021 13:27:13 +0300 Subject: [PATCH] go module support and tweak --- .travis.yml | 12 ++-- benchmarks_test.go | 144 ++++++++++++++++++++++----------------------- go.mod | 3 + 3 files changed, 80 insertions(+), 79 deletions(-) create mode 100644 go.mod diff --git a/.travis.yml b/.travis.yml index cc9ea1c..d4d2b27 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,11 +4,9 @@ install: - go get github.com/alioygur/is go: - - 1.1 - - 1.2 - - 1.3 - - 1.4 - - 1.5 - - 1.6 - - 1.7 + - 1.7.x + - 1.12.x + - 1.13.x + - 1.14.x + - 1.15.x - tip \ No newline at end of file diff --git a/benchmarks_test.go b/benchmarks_test.go index f7e6713..bfe87fd 100644 --- a/benchmarks_test.go +++ b/benchmarks_test.go @@ -18,95 +18,95 @@ type benchmarkCase struct { var ( benchmarkFuncs = []benchmarkCase{ // Alpha - benchmarkCase{Alpha, "Empty", ""}, - benchmarkCase{Alpha, "Space", " "}, - benchmarkCase{Alpha, "False", "abc!!!"}, - benchmarkCase{Alpha, "True", "abc"}, + {Alpha, "Empty", ""}, + {Alpha, "Space", " "}, + {Alpha, "False", "abc!!!"}, + {Alpha, "True", "abc"}, //UTFLetter - benchmarkCase{UTFLetter, "Empty", ""}, - benchmarkCase{UTFLetter, "Space", " "}, - benchmarkCase{UTFLetter, "False", "\u0026"}, //UTF-8(ASCII): & - benchmarkCase{UTFLetter, "True", "abc"}, + {UTFLetter, "Empty", ""}, + {UTFLetter, "Space", " "}, + {UTFLetter, "False", "\u0026"}, //UTF-8(ASCII): & + {UTFLetter, "True", "abc"}, // Alphanumeric - benchmarkCase{Alphanumeric, "Empty", ""}, - benchmarkCase{Alphanumeric, "Space", " "}, - benchmarkCase{Alphanumeric, "False", "\u0026"}, //UTF-8(ASCII): & - benchmarkCase{Alphanumeric, "True", "abc123"}, + {Alphanumeric, "Empty", ""}, + {Alphanumeric, "Space", " "}, + {Alphanumeric, "False", "\u0026"}, //UTF-8(ASCII): & + {Alphanumeric, "True", "abc123"}, // UTFLetterNumeric - benchmarkCase{UTFLetterNumeric, "Empty", ""}, - benchmarkCase{UTFLetterNumeric, "Space", " "}, - benchmarkCase{UTFLetterNumeric, "False", "abc!!!"}, - benchmarkCase{UTFLetterNumeric, "True", "abc1"}, + {UTFLetterNumeric, "Empty", ""}, + {UTFLetterNumeric, "Space", " "}, + {UTFLetterNumeric, "False", "abc!!!"}, + {UTFLetterNumeric, "True", "abc1"}, // Numeric - benchmarkCase{Numeric, "Empty", ""}, - benchmarkCase{Numeric, "Space", " "}, - benchmarkCase{Numeric, "False", "abc!!!"}, - benchmarkCase{Numeric, "True", "0123"}, + {Numeric, "Empty", ""}, + {Numeric, "Space", " "}, + {Numeric, "False", "abc!!!"}, + {Numeric, "True", "0123"}, // UTFNumeric - benchmarkCase{UTFNumeric, "Empty", ""}, - benchmarkCase{UTFNumeric, "Space", " "}, - benchmarkCase{UTFNumeric, "False", "abc!!!"}, - benchmarkCase{UTFNumeric, "True", "\u0030"}, //UTF-8(ASCII): 0 + {UTFNumeric, "Empty", ""}, + {UTFNumeric, "Space", " "}, + {UTFNumeric, "False", "abc!!!"}, + {UTFNumeric, "True", "\u0030"}, //UTF-8(ASCII): 0 // UTFDigit - benchmarkCase{UTFDigit, "Empty", ""}, - benchmarkCase{UTFDigit, "Space", " "}, - benchmarkCase{UTFDigit, "False", "abc!!!"}, - benchmarkCase{UTFDigit, "True", "\u0030"}, //UTF-8(ASCII): 0 + {UTFDigit, "Empty", ""}, + {UTFDigit, "Space", " "}, + {UTFDigit, "False", "abc!!!"}, + {UTFDigit, "True", "\u0030"}, //UTF-8(ASCII): 0 // LowerCase - benchmarkCase{LowerCase, "Empty", ""}, - benchmarkCase{LowerCase, "Space", " "}, - benchmarkCase{LowerCase, "False", "ABC"}, - benchmarkCase{LowerCase, "True", "abc"}, + {LowerCase, "Empty", ""}, + {LowerCase, "Space", " "}, + {LowerCase, "False", "ABC"}, + {LowerCase, "True", "abc"}, // UpperCase - benchmarkCase{UpperCase, "Empty", ""}, - benchmarkCase{UpperCase, "Space", " "}, - benchmarkCase{UpperCase, "False", "abc"}, - benchmarkCase{UpperCase, "True", "ABC"}, + {UpperCase, "Empty", ""}, + {UpperCase, "Space", " "}, + {UpperCase, "False", "abc"}, + {UpperCase, "True", "ABC"}, // Int - benchmarkCase{Int, "Empty", ""}, - benchmarkCase{Int, "Space", " "}, - benchmarkCase{Int, "False", "abc"}, - benchmarkCase{Int, "True", "000"}, + {Int, "Empty", ""}, + {Int, "Space", " "}, + {Int, "False", "abc"}, + {Int, "True", "000"}, // Email - benchmarkCase{Email, "Empty", ""}, - benchmarkCase{Email, "Space", " "}, - benchmarkCase{Email, "False", "@invalid.com"}, - benchmarkCase{Email, "True", "foo@bar.com"}, + {Email, "Empty", ""}, + {Email, "Space", " "}, + {Email, "False", "@invalid.com"}, + {Email, "True", "foo@bar.com"}, // URL - benchmarkCase{URL, "Empty", ""}, - benchmarkCase{URL, "Space", " "}, - benchmarkCase{URL, "False", "./rel/test/dir"}, - benchmarkCase{URL, "True", "http://foobar.org/"}, + {URL, "Empty", ""}, + {URL, "Space", " "}, + {URL, "False", "./rel/test/dir"}, + {URL, "True", "http://foobar.org/"}, // RequestURL - benchmarkCase{RequestURL, "Empty", ""}, - benchmarkCase{RequestURL, "Space", " "}, - benchmarkCase{RequestURL, "False", "invalid."}, - benchmarkCase{RequestURL, "True", "http://foobar.org/"}, + {RequestURL, "Empty", ""}, + {RequestURL, "Space", " "}, + {RequestURL, "False", "invalid."}, + {RequestURL, "True", "http://foobar.org/"}, // RequestURI - benchmarkCase{RequestURI, "Empty", ""}, - benchmarkCase{RequestURI, "Space", " "}, - benchmarkCase{RequestURI, "False", "invalid."}, - benchmarkCase{RequestURI, "True", "http://foobar.org/"}, + {RequestURI, "Empty", ""}, + {RequestURI, "Space", " "}, + {RequestURI, "False", "invalid."}, + {RequestURI, "True", "http://foobar.org/"}, // Float - benchmarkCase{Float, "Empty", ""}, - benchmarkCase{Float, "Space", " "}, - benchmarkCase{Float, "False", "+1f"}, - benchmarkCase{Float, "True", "123.123"}, + {Float, "Empty", ""}, + {Float, "Space", " "}, + {Float, "False", "+1f"}, + {Float, "True", "123.123"}, // Hexadecimal - benchmarkCase{Hexadecimal, "Empty", ""}, - benchmarkCase{Hexadecimal, "Space", " "}, - benchmarkCase{Hexadecimal, "False", ".."}, - benchmarkCase{Hexadecimal, "True", "deadBEEF"}, + {Hexadecimal, "Empty", ""}, + {Hexadecimal, "Space", " "}, + {Hexadecimal, "False", ".."}, + {Hexadecimal, "True", "deadBEEF"}, // Hexcolor - benchmarkCase{Hexcolor, "Empty", ""}, - benchmarkCase{Hexcolor, "Space", " "}, - benchmarkCase{Hexcolor, "False", "#ff12FG"}, - benchmarkCase{Hexcolor, "True", "#f00"}, + {Hexcolor, "Empty", ""}, + {Hexcolor, "Space", " "}, + {Hexcolor, "False", "#ff12FG"}, + {Hexcolor, "True", "#f00"}, // RGBcolor - benchmarkCase{RGBcolor, "Empty", ""}, - benchmarkCase{RGBcolor, "Space", " "}, - benchmarkCase{RGBcolor, "False", "rgba(0,31,255)"}, - benchmarkCase{RGBcolor, "True", "rgb(0,31,255)"}, + {RGBcolor, "Empty", ""}, + {RGBcolor, "Space", " "}, + {RGBcolor, "False", "rgba(0,31,255)"}, + {RGBcolor, "True", "rgb(0,31,255)"}, } ) diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..c436d62 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/alioygur/is + +go 1.15