// Convert the designated charset HTML to utf-8 encoded HTML.
// `charset` being one of the charsets known by the iconv package.
utfBody, err := iconv.NewReader(res.Body, charset, "utf-8")
if err != nil {
// handler error
}
var s string
fmt.Scanf("%q", &s)
// Или
scanner := bufio.NewScanner(os.Stdin)
for scanner.Scan() {
s := scanner.Text()
fmt.Println(s)
}
func (d date) toTime() time.Time {
return time.Parse("2006-01-02", string(d))
}
...
time, err := reservation.End.toTime()
if err != nil {
...
}
time.AddDate(0, 0, 1)
...
func (r reservations) Less(a, b int) bool {
aTime, _ := r[a].Start.toTime()
bTime, _ := r[b].Start.toTime()
return aTime.Sub(bTime) < 0
}
func dataValid(result []string) bool {
if v.IsLogin(result[0]) {
if isLoginAvailable(result[0]) {
if v.IsEmail(result[1]) {
if isEmailAvailable(result[1]) {
return v.IsPass(result[2])
}
}
}
}
return false
}
package main
import (
"bytes"
"fmt"
)
func main() {
var buffer bytes.Buffer
for i := 0; i < 1000; i++ {
buffer.WriteString("a")
}
fmt.Println(buffer.String())
}