type readerFunc func(p []byte) (n int, err error)
func (rf readerFunc) Read(p []byte) (n int, err error) { return rf(p) }
func Copy(ctx context.Context, dst io.Writer, src io.Reader) error {
_, err := io.Copy(dst, readerFunc(func(p []byte) (int, error) {
select {
case <-ctx.Done():
return 0, ctx.Err()package main
import (
"fmt"
"io"
"net/http"
"os"
"strconv"
"strings"
This file contains hidden or 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
| name: Validate Kubernetes YAML | |
| on: [pull_request] | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code |
This file contains hidden or 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
| class TimeoutError extends Error { | |
| error: unknown; | |
| constructor(timeoutMs: number, error: unknown) { | |
| super(`Operation timed out after ${timeoutMs}ms`); | |
| this.name = 'TimeoutError'; | |
| this.error = error; | |
| } | |
| } |
OlderNewer