8 Commits

Author SHA1 Message Date
hopehook
76a8ac8178 chore: remove build tag "+build !go1.20" 2023-03-01 10:22:15 +08:00
hopehook
f684de8618 chore: update Copyright 2023-02-08 23:23:26 +08:00
hopehook
ad7779d934 chore: add reference documentation link to comment of code 2023-02-08 17:40:59 +08:00
hopehook
aa844e102e Feat: Convert strings and slices using the officially recommended way.
Go official is expected to provide unsafe.{SliceData, Slice, StringData,
String} series methods in version 1.20 for conversion of strings and
slices.
2022-10-01 21:37:46 +08:00
Andy Pan
1bdf86b722
Remove the tedious named return value (#2620)
Co-authored-by: thinkerou <thinkerou@gmail.com>
2021-02-08 23:24:22 +08:00
thinkerou
3b5e861bb1
fix compile error from #2572 (#2600) 2021-01-03 21:14:56 +08:00
thinkerou
2773ce6e60
add copyright (#2388)
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-05-23 22:52:01 +08:00
Andy Pan
982daeb1ec Use zero-copy approach to convert types between string and byte… (#2206)
* Use zero-copy approach to convert types between string and byte slice

* Rename argument to a eligible one

Benchmark:

BenchmarkBytesConvBytesToStrRaw-4   	21003800	        70.9 ns/op	      96 B/op	       1 allocs/op
BenchmarkBytesConvBytesToStr-4      	1000000000	         0.333 ns/op	       0 B/op	       0 allocs/op
BenchmarkBytesConvStrToBytesRaw-4   	18478059	        59.3 ns/op	      96 B/op	       1 allocs/op
BenchmarkBytesConvStrToBytes-4      	1000000000	         0.373 ns/op	       0 B/op	       0 allocs/op


Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-01-18 00:32:50 +08:00