Created
March 5, 2020 02:44
-
-
Save tientp-floware/ce6119c050d005566e8bb5f5110c14a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "bytes" | |
func StreamToByte(stream io.Reader) []byte { | |
buf := new(bytes.Buffer) | |
buf.ReadFrom(stream) | |
return buf.Bytes() | |
} | |
func StreamToString(stream io.Reader) string { | |
buf := new(bytes.Buffer) | |
buf.ReadFrom(stream) | |
return buf.String() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have improve and other way to convert.