Write the implementation of request().
Условие
Заголовок раздела «Условие»Write the implementation of request().
func doRequest(addr string, request []byte) ([]byte, error) { resp, err := http.Post(addr, "text/plain ", bytes.NewBuffer(request)) if err != nil { return nil, err } defer resp.Body.Close()
body, err := io.ReadAll(resp.Body) if err != nil { return nil, err }
return body, nil}
type client struct { addrs []string}
func (dc client) request(ctx context.Context, req string) (string, error) { // implementation}Решение
Заголовок раздела «Решение»Источник: InDrive - 3 · Q3 2025
← Design a database for a company that ha… · Все задачи · Go · Что выведет на экран →