Go Package io: Difference between revisions
Jump to navigation
Jump to search
(→Reader) |
|||
Line 7: | Line 7: | ||
* [[Go_Language_Modularization#io|Standard Library]] | * [[Go_Language_Modularization#io|Standard Library]] | ||
* [[File Operations in Go#Overview|File Operations in Go]] | |||
=Overview= | =Overview= |
Revision as of 23:55, 18 December 2023
External
Internal
Overview
The io package consists of a few functions, but mostly interfaces used by other packages.
Reader
An interface that exposes Read()
.
Reader
s can be used to unmarshall JSON into structs as shown here:
Writer
ReadCloser
An interface that exposes basic Read()
and Close()
methods. The http.Request
body is a ReadCloser
. See Reader
.