From 8c8f725d047cf819506a3dbec680f869b9b1a4a6 Mon Sep 17 00:00:00 2001 From: Mike Jones Date: Tue, 16 Jan 2024 22:56:34 +0000 Subject: [PATCH] Upgrade to Go 1.21 --- .github/workflows/release.yml | 4 +- .github/workflows/test.yml | 4 +- go.mod | 16 +- go.sum | 22 + .../github.com/andybalholm/cascadia/README.md | 135 + .../github.com/andybalholm/cascadia/parser.go | 12 +- .../andybalholm/cascadia/pseudo_classes.go | 16 - vendor/github.com/mmcdole/gofeed/README.md | 2 +- .../github.com/mmcdole/gofeed/atom/parser.go | 40 +- vendor/github.com/mmcdole/gofeed/detector.go | 3 +- .../gofeed/internal/shared/parseutils.go | 21 + .../mmcdole/gofeed/internal/shared/xmlbase.go | 161 +- .../github.com/mmcdole/gofeed/rss/parser.go | 23 +- vendor/github.com/mmcdole/goxpp/xpp.go | 86 + vendor/github.com/sirupsen/logrus/README.md | 8 +- vendor/github.com/sirupsen/logrus/writer.go | 34 +- vendor/golang.org/x/net/html/doc.go | 21 + vendor/golang.org/x/net/html/escape.go | 81 + vendor/golang.org/x/net/html/render.go | 30 +- vendor/golang.org/x/net/html/token.go | 19 +- .../golang.org/x/net/internal/socks/socks.go | 2 +- .../sys/internal/unsafeheader/unsafeheader.go | 30 - vendor/golang.org/x/sys/unix/aliases.go | 2 - vendor/golang.org/x/sys/unix/asm_aix_ppc64.s | 1 - vendor/golang.org/x/sys/unix/asm_bsd_386.s | 2 - vendor/golang.org/x/sys/unix/asm_bsd_amd64.s | 2 - vendor/golang.org/x/sys/unix/asm_bsd_arm.s | 2 - vendor/golang.org/x/sys/unix/asm_bsd_arm64.s | 2 - vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s | 2 - .../golang.org/x/sys/unix/asm_bsd_riscv64.s | 2 - vendor/golang.org/x/sys/unix/asm_linux_386.s | 1 - .../golang.org/x/sys/unix/asm_linux_amd64.s | 1 - vendor/golang.org/x/sys/unix/asm_linux_arm.s | 1 - .../golang.org/x/sys/unix/asm_linux_arm64.s | 3 - .../golang.org/x/sys/unix/asm_linux_loong64.s | 3 - .../golang.org/x/sys/unix/asm_linux_mips64x.s | 3 - .../golang.org/x/sys/unix/asm_linux_mipsx.s | 3 - .../golang.org/x/sys/unix/asm_linux_ppc64x.s | 3 - .../golang.org/x/sys/unix/asm_linux_riscv64.s | 2 - .../golang.org/x/sys/unix/asm_linux_s390x.s | 3 - .../x/sys/unix/asm_openbsd_mips64.s | 1 - .../golang.org/x/sys/unix/asm_solaris_amd64.s | 1 - vendor/golang.org/x/sys/unix/asm_zos_s390x.s | 3 - vendor/golang.org/x/sys/unix/cap_freebsd.go | 1 - vendor/golang.org/x/sys/unix/constants.go | 1 - vendor/golang.org/x/sys/unix/dev_aix_ppc.go | 1 - vendor/golang.org/x/sys/unix/dev_aix_ppc64.go | 1 - vendor/golang.org/x/sys/unix/dev_zos.go | 1 - vendor/golang.org/x/sys/unix/dirent.go | 1 - vendor/golang.org/x/sys/unix/endian_big.go | 1 - vendor/golang.org/x/sys/unix/endian_little.go | 1 - vendor/golang.org/x/sys/unix/env_unix.go | 1 - vendor/golang.org/x/sys/unix/epoll_zos.go | 1 - vendor/golang.org/x/sys/unix/fcntl.go | 3 +- .../x/sys/unix/fcntl_linux_32bit.go | 1 - vendor/golang.org/x/sys/unix/fdset.go | 1 - vendor/golang.org/x/sys/unix/fstatfs_zos.go | 1 - vendor/golang.org/x/sys/unix/gccgo.go | 1 - vendor/golang.org/x/sys/unix/gccgo_c.c | 1 - .../x/sys/unix/gccgo_linux_amd64.go | 1 - vendor/golang.org/x/sys/unix/ifreq_linux.go | 1 - vendor/golang.org/x/sys/unix/ioctl_linux.go | 5 + vendor/golang.org/x/sys/unix/ioctl_signed.go | 69 + .../sys/unix/{ioctl.go => ioctl_unsigned.go} | 20 +- vendor/golang.org/x/sys/unix/ioctl_zos.go | 21 +- vendor/golang.org/x/sys/unix/mkall.sh | 2 +- vendor/golang.org/x/sys/unix/mkerrors.sh | 55 +- vendor/golang.org/x/sys/unix/mmap_nomremap.go | 13 + vendor/golang.org/x/sys/unix/mremap.go | 52 + vendor/golang.org/x/sys/unix/pagesize_unix.go | 1 - .../golang.org/x/sys/unix/pledge_openbsd.go | 92 +- vendor/golang.org/x/sys/unix/ptrace_darwin.go | 1 - vendor/golang.org/x/sys/unix/ptrace_ios.go | 1 - vendor/golang.org/x/sys/unix/race.go | 1 - vendor/golang.org/x/sys/unix/race0.go | 1 - .../x/sys/unix/readdirent_getdents.go | 1 - .../x/sys/unix/readdirent_getdirentries.go | 1 - vendor/golang.org/x/sys/unix/sockcmsg_unix.go | 1 - .../x/sys/unix/sockcmsg_unix_other.go | 1 - vendor/golang.org/x/sys/unix/syscall.go | 1 - vendor/golang.org/x/sys/unix/syscall_aix.go | 28 +- .../golang.org/x/sys/unix/syscall_aix_ppc.go | 2 - .../x/sys/unix/syscall_aix_ppc64.go | 2 - vendor/golang.org/x/sys/unix/syscall_bsd.go | 20 +- .../golang.org/x/sys/unix/syscall_darwin.go | 251 +- .../x/sys/unix/syscall_darwin_amd64.go | 1 - .../x/sys/unix/syscall_darwin_arm64.go | 1 - .../x/sys/unix/syscall_darwin_libSystem.go | 1 - .../x/sys/unix/syscall_dragonfly.go | 200 +- .../x/sys/unix/syscall_dragonfly_amd64.go | 1 - .../golang.org/x/sys/unix/syscall_freebsd.go | 236 +- .../x/sys/unix/syscall_freebsd_386.go | 18 +- .../x/sys/unix/syscall_freebsd_amd64.go | 18 +- .../x/sys/unix/syscall_freebsd_arm.go | 16 +- .../x/sys/unix/syscall_freebsd_arm64.go | 16 +- .../x/sys/unix/syscall_freebsd_riscv64.go | 16 +- vendor/golang.org/x/sys/unix/syscall_hurd.go | 9 +- .../golang.org/x/sys/unix/syscall_hurd_386.go | 1 - .../golang.org/x/sys/unix/syscall_illumos.go | 1 - vendor/golang.org/x/sys/unix/syscall_linux.go | 299 +- .../x/sys/unix/syscall_linux_386.go | 28 - .../x/sys/unix/syscall_linux_alarm.go | 2 - .../x/sys/unix/syscall_linux_amd64.go | 4 +- .../x/sys/unix/syscall_linux_amd64_gc.go | 1 - .../x/sys/unix/syscall_linux_arm.go | 28 - .../x/sys/unix/syscall_linux_arm64.go | 13 +- .../golang.org/x/sys/unix/syscall_linux_gc.go | 1 - .../x/sys/unix/syscall_linux_gc_386.go | 1 - .../x/sys/unix/syscall_linux_gc_arm.go | 1 - .../x/sys/unix/syscall_linux_gccgo_386.go | 1 - .../x/sys/unix/syscall_linux_gccgo_arm.go | 1 - .../x/sys/unix/syscall_linux_loong64.go | 8 +- .../x/sys/unix/syscall_linux_mips64x.go | 5 +- .../x/sys/unix/syscall_linux_mipsx.go | 29 - .../x/sys/unix/syscall_linux_ppc.go | 28 - .../x/sys/unix/syscall_linux_ppc64x.go | 3 - .../x/sys/unix/syscall_linux_riscv64.go | 15 +- .../x/sys/unix/syscall_linux_s390x.go | 2 - .../x/sys/unix/syscall_linux_sparc64.go | 2 - .../golang.org/x/sys/unix/syscall_netbsd.go | 279 +- .../x/sys/unix/syscall_netbsd_386.go | 1 - .../x/sys/unix/syscall_netbsd_amd64.go | 1 - .../x/sys/unix/syscall_netbsd_arm.go | 1 - .../x/sys/unix/syscall_netbsd_arm64.go | 1 - .../golang.org/x/sys/unix/syscall_openbsd.go | 121 +- .../x/sys/unix/syscall_openbsd_386.go | 1 - .../x/sys/unix/syscall_openbsd_amd64.go | 1 - .../x/sys/unix/syscall_openbsd_arm.go | 1 - .../x/sys/unix/syscall_openbsd_arm64.go | 1 - .../x/sys/unix/syscall_openbsd_libc.go | 1 - .../x/sys/unix/syscall_openbsd_ppc64.go | 1 - .../x/sys/unix/syscall_openbsd_riscv64.go | 1 - .../golang.org/x/sys/unix/syscall_solaris.go | 73 +- .../x/sys/unix/syscall_solaris_amd64.go | 1 - vendor/golang.org/x/sys/unix/syscall_unix.go | 19 +- .../golang.org/x/sys/unix/syscall_unix_gc.go | 2 - .../x/sys/unix/syscall_unix_gc_ppc64x.go | 3 - .../x/sys/unix/syscall_zos_s390x.go | 24 +- vendor/golang.org/x/sys/unix/sysvshm_linux.go | 1 - vendor/golang.org/x/sys/unix/sysvshm_unix.go | 1 - .../x/sys/unix/sysvshm_unix_other.go | 1 - vendor/golang.org/x/sys/unix/timestruct.go | 1 - .../golang.org/x/sys/unix/unveil_openbsd.go | 41 +- vendor/golang.org/x/sys/unix/xattr_bsd.go | 1 - .../golang.org/x/sys/unix/zerrors_aix_ppc.go | 1 - .../x/sys/unix/zerrors_aix_ppc64.go | 1 - .../x/sys/unix/zerrors_darwin_amd64.go | 20 +- .../x/sys/unix/zerrors_darwin_arm64.go | 20 +- .../x/sys/unix/zerrors_dragonfly_amd64.go | 1 - .../x/sys/unix/zerrors_freebsd_386.go | 1 - .../x/sys/unix/zerrors_freebsd_amd64.go | 1 - .../x/sys/unix/zerrors_freebsd_arm.go | 1 - .../x/sys/unix/zerrors_freebsd_arm64.go | 1 - .../x/sys/unix/zerrors_freebsd_riscv64.go | 1 - vendor/golang.org/x/sys/unix/zerrors_linux.go | 144 +- .../x/sys/unix/zerrors_linux_386.go | 12 +- .../x/sys/unix/zerrors_linux_amd64.go | 12 +- .../x/sys/unix/zerrors_linux_arm.go | 12 +- .../x/sys/unix/zerrors_linux_arm64.go | 14 +- .../x/sys/unix/zerrors_linux_loong64.go | 15 +- .../x/sys/unix/zerrors_linux_mips.go | 12 +- .../x/sys/unix/zerrors_linux_mips64.go | 12 +- .../x/sys/unix/zerrors_linux_mips64le.go | 12 +- .../x/sys/unix/zerrors_linux_mipsle.go | 12 +- .../x/sys/unix/zerrors_linux_ppc.go | 12 +- .../x/sys/unix/zerrors_linux_ppc64.go | 12 +- .../x/sys/unix/zerrors_linux_ppc64le.go | 12 +- .../x/sys/unix/zerrors_linux_riscv64.go | 15 +- .../x/sys/unix/zerrors_linux_s390x.go | 12 +- .../x/sys/unix/zerrors_linux_sparc64.go | 60 +- .../x/sys/unix/zerrors_netbsd_386.go | 1 - .../x/sys/unix/zerrors_netbsd_amd64.go | 1 - .../x/sys/unix/zerrors_netbsd_arm.go | 1 - .../x/sys/unix/zerrors_netbsd_arm64.go | 1 - .../x/sys/unix/zerrors_openbsd_386.go | 1 - .../x/sys/unix/zerrors_openbsd_amd64.go | 1 - .../x/sys/unix/zerrors_openbsd_arm.go | 1 - .../x/sys/unix/zerrors_openbsd_arm64.go | 1 - .../x/sys/unix/zerrors_openbsd_mips64.go | 1 - .../x/sys/unix/zerrors_openbsd_ppc64.go | 1 - .../x/sys/unix/zerrors_openbsd_riscv64.go | 1 - .../x/sys/unix/zerrors_solaris_amd64.go | 1 - .../x/sys/unix/zerrors_zos_s390x.go | 1 - .../x/sys/unix/zptrace_armnn_linux.go | 10 +- .../x/sys/unix/zptrace_linux_arm64.go | 4 +- .../x/sys/unix/zptrace_mipsnn_linux.go | 10 +- .../x/sys/unix/zptrace_mipsnnle_linux.go | 10 +- .../x/sys/unix/zptrace_x86_linux.go | 10 +- .../golang.org/x/sys/unix/zsyscall_aix_ppc.go | 46 +- .../x/sys/unix/zsyscall_aix_ppc64.go | 47 +- .../x/sys/unix/zsyscall_aix_ppc64_gc.go | 18 +- .../x/sys/unix/zsyscall_aix_ppc64_gccgo.go | 19 +- .../x/sys/unix/zsyscall_darwin_amd64.go | 72 +- .../x/sys/unix/zsyscall_darwin_amd64.s | 160 +- .../x/sys/unix/zsyscall_darwin_arm64.go | 72 +- .../x/sys/unix/zsyscall_darwin_arm64.s | 160 +- .../x/sys/unix/zsyscall_dragonfly_amd64.go | 43 +- .../x/sys/unix/zsyscall_freebsd_386.go | 53 +- .../x/sys/unix/zsyscall_freebsd_amd64.go | 53 +- .../x/sys/unix/zsyscall_freebsd_arm.go | 53 +- .../x/sys/unix/zsyscall_freebsd_arm64.go | 53 +- .../x/sys/unix/zsyscall_freebsd_riscv64.go | 53 +- .../x/sys/unix/zsyscall_illumos_amd64.go | 11 +- .../golang.org/x/sys/unix/zsyscall_linux.go | 115 +- .../x/sys/unix/zsyscall_linux_386.go | 11 - .../x/sys/unix/zsyscall_linux_amd64.go | 11 - .../x/sys/unix/zsyscall_linux_arm.go | 11 - .../x/sys/unix/zsyscall_linux_arm64.go | 11 - .../x/sys/unix/zsyscall_linux_loong64.go | 1 - .../x/sys/unix/zsyscall_linux_mips.go | 11 - .../x/sys/unix/zsyscall_linux_mips64.go | 11 - .../x/sys/unix/zsyscall_linux_mips64le.go | 11 - .../x/sys/unix/zsyscall_linux_mipsle.go | 11 - .../x/sys/unix/zsyscall_linux_ppc.go | 11 - .../x/sys/unix/zsyscall_linux_ppc64.go | 11 - .../x/sys/unix/zsyscall_linux_ppc64le.go | 11 - .../x/sys/unix/zsyscall_linux_riscv64.go | 27 +- .../x/sys/unix/zsyscall_linux_s390x.go | 11 - .../x/sys/unix/zsyscall_linux_sparc64.go | 11 - .../x/sys/unix/zsyscall_netbsd_386.go | 50 +- .../x/sys/unix/zsyscall_netbsd_amd64.go | 50 +- .../x/sys/unix/zsyscall_netbsd_arm.go | 50 +- .../x/sys/unix/zsyscall_netbsd_arm64.go | 50 +- .../x/sys/unix/zsyscall_openbsd_386.go | 116 +- .../x/sys/unix/zsyscall_openbsd_386.s | 35 +- .../x/sys/unix/zsyscall_openbsd_amd64.go | 116 +- .../x/sys/unix/zsyscall_openbsd_amd64.s | 35 +- .../x/sys/unix/zsyscall_openbsd_arm.go | 116 +- .../x/sys/unix/zsyscall_openbsd_arm.s | 35 +- .../x/sys/unix/zsyscall_openbsd_arm64.go | 116 +- .../x/sys/unix/zsyscall_openbsd_arm64.s | 35 +- .../x/sys/unix/zsyscall_openbsd_mips64.go | 116 +- .../x/sys/unix/zsyscall_openbsd_mips64.s | 35 +- .../x/sys/unix/zsyscall_openbsd_ppc64.go | 116 +- .../x/sys/unix/zsyscall_openbsd_ppc64.s | 42 +- .../x/sys/unix/zsyscall_openbsd_riscv64.go | 116 +- .../x/sys/unix/zsyscall_openbsd_riscv64.s | 35 +- .../x/sys/unix/zsyscall_solaris_amd64.go | 281 +- .../x/sys/unix/zsyscall_zos_s390x.go | 24 +- .../x/sys/unix/zsysctl_openbsd_386.go | 1 - .../x/sys/unix/zsysctl_openbsd_amd64.go | 1 - .../x/sys/unix/zsysctl_openbsd_arm.go | 1 - .../x/sys/unix/zsysctl_openbsd_arm64.go | 1 - .../x/sys/unix/zsysctl_openbsd_mips64.go | 1 - .../x/sys/unix/zsysctl_openbsd_ppc64.go | 1 - .../x/sys/unix/zsysctl_openbsd_riscv64.go | 1 - .../x/sys/unix/zsysnum_darwin_amd64.go | 1 - .../x/sys/unix/zsysnum_darwin_arm64.go | 1 - .../x/sys/unix/zsysnum_dragonfly_amd64.go | 1 - .../x/sys/unix/zsysnum_freebsd_386.go | 1 - .../x/sys/unix/zsysnum_freebsd_amd64.go | 1 - .../x/sys/unix/zsysnum_freebsd_arm.go | 1 - .../x/sys/unix/zsysnum_freebsd_arm64.go | 1 - .../x/sys/unix/zsysnum_freebsd_riscv64.go | 1 - .../x/sys/unix/zsysnum_linux_386.go | 3 +- .../x/sys/unix/zsysnum_linux_amd64.go | 4 +- .../x/sys/unix/zsysnum_linux_arm.go | 3 +- .../x/sys/unix/zsysnum_linux_arm64.go | 3 +- .../x/sys/unix/zsysnum_linux_loong64.go | 3 +- .../x/sys/unix/zsysnum_linux_mips.go | 3 +- .../x/sys/unix/zsysnum_linux_mips64.go | 3 +- .../x/sys/unix/zsysnum_linux_mips64le.go | 3 +- .../x/sys/unix/zsysnum_linux_mipsle.go | 3 +- .../x/sys/unix/zsysnum_linux_ppc.go | 3 +- .../x/sys/unix/zsysnum_linux_ppc64.go | 3 +- .../x/sys/unix/zsysnum_linux_ppc64le.go | 3 +- .../x/sys/unix/zsysnum_linux_riscv64.go | 5 +- .../x/sys/unix/zsysnum_linux_s390x.go | 4 +- .../x/sys/unix/zsysnum_linux_sparc64.go | 3 +- .../x/sys/unix/zsysnum_netbsd_386.go | 1 - .../x/sys/unix/zsysnum_netbsd_amd64.go | 1 - .../x/sys/unix/zsysnum_netbsd_arm.go | 1 - .../x/sys/unix/zsysnum_netbsd_arm64.go | 1 - .../x/sys/unix/zsysnum_openbsd_386.go | 1 - .../x/sys/unix/zsysnum_openbsd_amd64.go | 1 - .../x/sys/unix/zsysnum_openbsd_arm.go | 1 - .../x/sys/unix/zsysnum_openbsd_arm64.go | 1 - .../x/sys/unix/zsysnum_openbsd_mips64.go | 1 - .../x/sys/unix/zsysnum_openbsd_ppc64.go | 1 - .../x/sys/unix/zsysnum_openbsd_riscv64.go | 1 - .../x/sys/unix/zsysnum_zos_s390x.go | 1 - .../golang.org/x/sys/unix/ztypes_aix_ppc.go | 1 - .../golang.org/x/sys/unix/ztypes_aix_ppc64.go | 1 - .../x/sys/unix/ztypes_darwin_amd64.go | 12 +- .../x/sys/unix/ztypes_darwin_arm64.go | 12 +- .../x/sys/unix/ztypes_dragonfly_amd64.go | 1 - .../x/sys/unix/ztypes_freebsd_386.go | 3 +- .../x/sys/unix/ztypes_freebsd_amd64.go | 3 +- .../x/sys/unix/ztypes_freebsd_arm.go | 3 +- .../x/sys/unix/ztypes_freebsd_arm64.go | 3 +- .../x/sys/unix/ztypes_freebsd_riscv64.go | 3 +- vendor/golang.org/x/sys/unix/ztypes_linux.go | 270 +- .../golang.org/x/sys/unix/ztypes_linux_386.go | 5 +- .../x/sys/unix/ztypes_linux_amd64.go | 5 +- .../golang.org/x/sys/unix/ztypes_linux_arm.go | 5 +- .../x/sys/unix/ztypes_linux_arm64.go | 5 +- .../x/sys/unix/ztypes_linux_loong64.go | 5 +- .../x/sys/unix/ztypes_linux_mips.go | 5 +- .../x/sys/unix/ztypes_linux_mips64.go | 5 +- .../x/sys/unix/ztypes_linux_mips64le.go | 5 +- .../x/sys/unix/ztypes_linux_mipsle.go | 5 +- .../golang.org/x/sys/unix/ztypes_linux_ppc.go | 5 +- .../x/sys/unix/ztypes_linux_ppc64.go | 5 +- .../x/sys/unix/ztypes_linux_ppc64le.go | 5 +- .../x/sys/unix/ztypes_linux_riscv64.go | 32 +- .../x/sys/unix/ztypes_linux_s390x.go | 5 +- .../x/sys/unix/ztypes_linux_sparc64.go | 5 +- .../x/sys/unix/ztypes_netbsd_386.go | 1 - .../x/sys/unix/ztypes_netbsd_amd64.go | 1 - .../x/sys/unix/ztypes_netbsd_arm.go | 1 - .../x/sys/unix/ztypes_netbsd_arm64.go | 1 - .../x/sys/unix/ztypes_openbsd_386.go | 1 - .../x/sys/unix/ztypes_openbsd_amd64.go | 1 - .../x/sys/unix/ztypes_openbsd_arm.go | 1 - .../x/sys/unix/ztypes_openbsd_arm64.go | 1 - .../x/sys/unix/ztypes_openbsd_mips64.go | 1 - .../x/sys/unix/ztypes_openbsd_ppc64.go | 1 - .../x/sys/unix/ztypes_openbsd_riscv64.go | 1 - .../x/sys/unix/ztypes_solaris_amd64.go | 1 - .../golang.org/x/sys/unix/ztypes_zos_s390x.go | 1 - vendor/golang.org/x/sys/windows/aliases.go | 1 - vendor/golang.org/x/sys/windows/empty.s | 1 - .../golang.org/x/sys/windows/env_windows.go | 6 +- vendor/golang.org/x/sys/windows/eventlog.go | 1 - .../golang.org/x/sys/windows/exec_windows.go | 92 +- vendor/golang.org/x/sys/windows/mksyscall.go | 1 - vendor/golang.org/x/sys/windows/race.go | 1 - vendor/golang.org/x/sys/windows/race0.go | 1 - .../x/sys/windows/security_windows.go | 21 +- vendor/golang.org/x/sys/windows/service.go | 12 +- vendor/golang.org/x/sys/windows/str.go | 1 - vendor/golang.org/x/sys/windows/syscall.go | 1 - .../x/sys/windows/syscall_windows.go | 83 +- .../golang.org/x/sys/windows/types_windows.go | 130 +- .../x/sys/windows/zsyscall_windows.go | 135 +- .../x/text/encoding/internal/internal.go | 2 +- .../text/internal/language/compact/tables.go | 356 +- .../x/text/internal/language/tables.go | 4686 +++++++++-------- vendor/golang.org/x/text/language/match.go | 2 +- vendor/golang.org/x/text/language/tables.go | 138 +- vendor/modules.txt | 23 +- 341 files changed, 6307 insertions(+), 6204 deletions(-) delete mode 100644 vendor/golang.org/x/sys/internal/unsafeheader/unsafeheader.go create mode 100644 vendor/golang.org/x/sys/unix/ioctl_signed.go rename vendor/golang.org/x/sys/unix/{ioctl.go => ioctl_unsigned.go} (76%) create mode 100644 vendor/golang.org/x/sys/unix/mmap_nomremap.go create mode 100644 vendor/golang.org/x/sys/unix/mremap.go diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4b67913..5d0745d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,12 +17,12 @@ jobs: GO111MODULE: 'on' steps: - - name: 'Set up Go 1.19' + - name: 'Set up Go 1.21' env: RUNNER_TEMP: '/tmp' uses: 'actions/setup-go@v3' with: - go-version: '^1.19' + go-version: '^1.21' id: 'go' - name: 'Check out code' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4f0fb12..c3d5874 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,12 +15,12 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.19 + - name: Set up Go 1.21 env: RUNNER_TEMP: /tmp uses: actions/setup-go@v3 with: - go-version: ^1.19 + go-version: ^1.21 id: go - name: Check out code into the Go module directory diff --git a/go.mod b/go.mod index d9acb63..47813c0 100644 --- a/go.mod +++ b/go.mod @@ -1,23 +1,23 @@ module github.com/n7st/rssirc -go 1.19 +go 1.21 require ( - github.com/mmcdole/gofeed v1.2.0 + github.com/mmcdole/gofeed v1.2.1 github.com/shibukawa/configdir v0.0.0-20170330084843-e180dbdc8da0 - github.com/sirupsen/logrus v1.9.0 + github.com/sirupsen/logrus v1.9.3 github.com/thoj/go-ircevent v0.0.0-20210723090443-73e444401d64 gopkg.in/yaml.v2 v2.4.0 ) require ( github.com/PuerkitoBio/goquery v1.8.1 // indirect - github.com/andybalholm/cascadia v1.3.1 // indirect + github.com/andybalholm/cascadia v1.3.2 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/mmcdole/goxpp v1.0.0 // indirect + github.com/mmcdole/goxpp v1.1.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + golang.org/x/net v0.20.0 // indirect + golang.org/x/sys v0.16.0 // indirect + golang.org/x/text v0.14.0 // indirect ) diff --git a/go.sum b/go.sum index 552e743..de33a8f 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,8 @@ github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAc github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ= github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= +github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss= +github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -10,8 +12,12 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/mmcdole/gofeed v1.2.0 h1:kuq7tJnDf0pnsDzF820ukuySHxFimAcizpG15gYHIns= github.com/mmcdole/gofeed v1.2.0/go.mod h1:TEyTG4gw4Q5Co+Hgahx/Oi3E0JHLM8BXtWC+mkJtRsw= +github.com/mmcdole/gofeed v1.2.1 h1:tPbFN+mfOLcM1kDF1x2c/N68ChbdBatkppdzf/vDe1s= +github.com/mmcdole/gofeed v1.2.1/go.mod h1:2wVInNpgmC85q16QTTuwbuKxtKkHLCDDtf0dCmnrNr4= github.com/mmcdole/goxpp v1.0.0 h1:/eu75G4jwH/LaugmPVB0FFC8LdKw00UMrpo6N7ym45o= github.com/mmcdole/goxpp v1.0.0/go.mod h1:v+25+lT2ViuQ7mVxcncQ8ch1URund48oH+jhjiwEgS8= +github.com/mmcdole/goxpp v1.1.0 h1:WwslZNF7KNAXTFuzRtn/OKZxFLJAAyOA9w82mDz2ZGI= +github.com/mmcdole/goxpp v1.1.0/go.mod h1:v+25+lT2ViuQ7mVxcncQ8ch1URund48oH+jhjiwEgS8= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -23,6 +29,8 @@ github.com/shibukawa/configdir v0.0.0-20170330084843-e180dbdc8da0 h1:Xuk8ma/ibJ1 github.com/shibukawa/configdir v0.0.0-20170330084843-e180dbdc8da0/go.mod h1:7AwjWCpdPhkSmNAgUv5C7EJ4AbmjEB3r047r3DXWu3Y= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -33,15 +41,21 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -51,18 +65,26 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/vendor/github.com/andybalholm/cascadia/README.md b/vendor/github.com/andybalholm/cascadia/README.md index 26f4c37..6433cb9 100644 --- a/vendor/github.com/andybalholm/cascadia/README.md +++ b/vendor/github.com/andybalholm/cascadia/README.md @@ -7,3 +7,138 @@ The Cascadia package implements CSS selectors for use with the parse trees produ To test CSS selectors without writing Go code, check out [cascadia](https://github.com/suntong/cascadia) the command line tool, a thin wrapper around this package. [Refer to godoc here](https://godoc.org/github.com/andybalholm/cascadia). + +## Example + +The following is an example of how you can use Cascadia. + +```go +package main + +import ( + "fmt" + "log" + "strings" + + "github.com/andybalholm/cascadia" + "golang.org/x/net/html" +) + +var pricingHtml string = ` +
+
+

Free

+
+
+

$0/mo

+
    +
  • 10 users included
  • +
  • 2 GB of storage
  • +
  • See more
  • +
+
+
+ +
+
+

Pro

+
+
+

$15/mo

+
    +
  • 20 users included
  • +
  • 10 GB of storage
  • +
  • See more
  • +
+
+
+ +
+
+

Enterprise

+
+
+

$29/mo

+
    +
  • 30 users included
  • +
  • 15 GB of storage
  • +
  • See more
  • +
+
+
+` + +func Query(n *html.Node, query string) *html.Node { + sel, err := cascadia.Parse(query) + if err != nil { + return &html.Node{} + } + return cascadia.Query(n, sel) +} + +func QueryAll(n *html.Node, query string) []*html.Node { + sel, err := cascadia.Parse(query) + if err != nil { + return []*html.Node{} + } + return cascadia.QueryAll(n, sel) +} + +func AttrOr(n *html.Node, attrName, or string) string { + for _, a := range n.Attr { + if a.Key == attrName { + return a.Val + } + } + return or +} + +func main() { + doc, err := html.Parse(strings.NewReader(pricingHtml)) + if err != nil { + log.Fatal(err) + } + fmt.Printf("List of pricing plans:\n\n") + for i, p := range QueryAll(doc, "div.card.mb-4.box-shadow") { + planName := Query(p, "h4").FirstChild.Data + price := Query(p, ".pricing-card-title").FirstChild.Data + usersIncluded := Query(p, "li:first-child").FirstChild.Data + storage := Query(p, "li:nth-child(2)").FirstChild.Data + detailsUrl := AttrOr(Query(p, "li:last-child a"), "href", "(No link available)") + fmt.Printf( + "Plan #%d\nName: %s\nPrice: %s\nUsers: %s\nStorage: %s\nDetails: %s\n\n", + i+1, + planName, + price, + usersIncluded, + storage, + detailsUrl, + ) + } +} +``` +The output is: +``` +List of pricing plans: + +Plan #1 +Name: Free +Price: $0/mo +Users: 10 users included +Storage: 2 GB of storage +Details: https://example.com + +Plan #2 +Name: Pro +Price: $15/mo +Users: 20 users included +Storage: 10 GB of storage +Details: https://example.com + +Plan #3 +Name: Enterprise +Price: $29/mo +Users: 30 users included +Storage: 15 GB of storage +Details: (No link available) +``` diff --git a/vendor/github.com/andybalholm/cascadia/parser.go b/vendor/github.com/andybalholm/cascadia/parser.go index f654c0c..06eccd5 100644 --- a/vendor/github.com/andybalholm/cascadia/parser.go +++ b/vendor/github.com/andybalholm/cascadia/parser.go @@ -97,10 +97,12 @@ func nameChar(c byte) bool { // parseIdentifier parses an identifier. func (p *parser) parseIdentifier() (result string, err error) { - startingDash := false - if len(p.s) > p.i && p.s[p.i] == '-' { - startingDash = true + const prefix = '-' + var numPrefix int + + for len(p.s) > p.i && p.s[p.i] == prefix { p.i++ + numPrefix++ } if len(p.s) <= p.i { @@ -112,8 +114,8 @@ func (p *parser) parseIdentifier() (result string, err error) { } result, err = p.parseName() - if startingDash && err == nil { - result = "-" + result + if numPrefix > 0 && err == nil { + result = strings.Repeat(string(prefix), numPrefix) + result } return } diff --git a/vendor/github.com/andybalholm/cascadia/pseudo_classes.go b/vendor/github.com/andybalholm/cascadia/pseudo_classes.go index 3986b22..6234c3e 100644 --- a/vendor/github.com/andybalholm/cascadia/pseudo_classes.go +++ b/vendor/github.com/andybalholm/cascadia/pseudo_classes.go @@ -184,10 +184,6 @@ func nthChildMatch(a, b int, last, ofType bool, n *html.Node) bool { return false } - if parent.Type == html.DocumentNode { - return false - } - i := -1 count := 0 for c := parent.FirstChild; c != nil; c = c.NextSibling { @@ -232,10 +228,6 @@ func simpleNthChildMatch(b int, ofType bool, n *html.Node) bool { return false } - if parent.Type == html.DocumentNode { - return false - } - count := 0 for c := parent.FirstChild; c != nil; c = c.NextSibling { if c.Type != html.ElementNode || (ofType && c.Data != n.Data) { @@ -264,10 +256,6 @@ func simpleNthLastChildMatch(b int, ofType bool, n *html.Node) bool { return false } - if parent.Type == html.DocumentNode { - return false - } - count := 0 for c := parent.LastChild; c != nil; c = c.PrevSibling { if c.Type != html.ElementNode || (ofType && c.Data != n.Data) { @@ -301,10 +289,6 @@ func (s onlyChildPseudoClassSelector) Match(n *html.Node) bool { return false } - if parent.Type == html.DocumentNode { - return false - } - count := 0 for c := parent.FirstChild; c != nil; c = c.NextSibling { if (c.Type != html.ElementNode) || (s.ofType && c.Data != n.Data) { diff --git a/vendor/github.com/mmcdole/gofeed/README.md b/vendor/github.com/mmcdole/gofeed/README.md index 31125a1..a69d6d2 100644 --- a/vendor/github.com/mmcdole/gofeed/README.md +++ b/vendor/github.com/mmcdole/gofeed/README.md @@ -42,7 +42,7 @@ It parses all other feed extensions in a generic way (see the [Extensions](#exte #### Invalid Feeds -A best-effort attempt is made at parsing broken and invalid XML feeds. Currently, `gofeed` can succesfully parse feeds with the following issues: +A best-effort attempt is made at parsing broken and invalid XML feeds. Currently, `gofeed` can successfully parse feeds with the following issues: * Unescaped/Naked Markup in feed elements * Undeclared namespace prefixes diff --git a/vendor/github.com/mmcdole/gofeed/atom/parser.go b/vendor/github.com/mmcdole/gofeed/atom/parser.go index 000ace6..0908114 100644 --- a/vendor/github.com/mmcdole/gofeed/atom/parser.go +++ b/vendor/github.com/mmcdole/gofeed/atom/parser.go @@ -14,35 +14,23 @@ import ( var ( // Atom elements which contain URIs // https://tools.ietf.org/html/rfc4287 - uriElements = map[string]bool{ + atomUriElements = map[string]bool{ "icon": true, "id": true, "logo": true, "uri": true, "url": true, // atom 0.3 } - - // Atom attributes which contain URIs - // https://tools.ietf.org/html/rfc4287 - atomURIAttrs = map[string]bool{ - "href": true, - "scheme": true, - "src": true, - "uri": true, - } ) // Parser is an Atom Parser -type Parser struct { - base *shared.XMLBase -} +type Parser struct{} // Parse parses an xml feed into an atom.Feed func (ap *Parser) Parse(feed io.Reader) (*Feed, error) { p := xpp.NewXMLPullParser(feed, false, shared.NewReaderLabel) - ap.base = &shared.XMLBase{URIAttrs: atomURIAttrs} - _, err := ap.base.FindRoot(p) + _, err := shared.FindRoot(p) if err != nil { return nil, err } @@ -67,7 +55,7 @@ func (ap *Parser) parseRoot(p *xpp.XMLPullParser) (*Feed, error) { extensions := ext.Extensions{} for { - tok, err := ap.base.NextTag(p) + tok, err := shared.NextTag(p) if err != nil { return nil, err } @@ -221,7 +209,7 @@ func (ap *Parser) parseEntry(p *xpp.XMLPullParser) (*Entry, error) { extensions := ext.Extensions{} for { - tok, err := ap.base.NextTag(p) + tok, err := shared.NextTag(p) if err != nil { return nil, err } @@ -376,7 +364,7 @@ func (ap *Parser) parseSource(p *xpp.XMLPullParser) (*Source, error) { extensions := ext.Extensions{} for { - tok, err := ap.base.NextTag(p) + tok, err := shared.NextTag(p) if err != nil { return nil, err } @@ -534,7 +522,7 @@ func (ap *Parser) parsePerson(name string, p *xpp.XMLPullParser) (*Person, error person := &Person{} for { - tok, err := ap.base.NextTag(p) + tok, err := shared.NextTag(p) if err != nil { return nil, err } @@ -684,7 +672,7 @@ func (ap *Parser) parseAtomText(p *xpp.XMLPullParser) (string, error) { if strings.Contains(result, "" +// FindRoot iterates through the tokens of an xml document until +// it encounters its first StartTag event. It returns an error +// if it reaches EndDocument before finding a tag. +func FindRoot(p *xpp.XMLPullParser) (event xpp.XMLEventType, err error) { + for { + event, err = p.Next() + if err != nil { + return event, err + } + if event == xpp.StartTag { + break + } + + if event == xpp.EndDocument { + return event, fmt.Errorf("Failed to find root node before document end.") + } + } + return +} + // ParseText is a helper function for parsing the text // from the current element of the XMLPullParser. // This function can handle parsing naked XML text from diff --git a/vendor/github.com/mmcdole/gofeed/internal/shared/xmlbase.go b/vendor/github.com/mmcdole/gofeed/internal/shared/xmlbase.go index bfab57e..88c856f 100644 --- a/vendor/github.com/mmcdole/gofeed/internal/shared/xmlbase.go +++ b/vendor/github.com/mmcdole/gofeed/internal/shared/xmlbase.go @@ -3,11 +3,10 @@ package shared import ( "bytes" "fmt" - "golang.org/x/net/html" - "net/url" "strings" - "github.com/mmcdole/goxpp" + xpp "github.com/mmcdole/goxpp" + "golang.org/x/net/html" ) var ( @@ -29,72 +28,26 @@ var ( "uri": true, "usemap": true, } -) - -type urlStack []*url.URL -func (s *urlStack) push(u *url.URL) { - *s = append([]*url.URL{u}, *s...) -} - -func (s *urlStack) pop() *url.URL { - if s == nil || len(*s) == 0 { - return nil + // List of xml attributes that contain URIs to be resolved relative to + // xml:base + // From the Atom spec https://tools.ietf.org/html/rfc4287 + uriAttrs = map[string]bool{ + "href": true, + "scheme": true, + "src": true, + "uri": true, } - var top *url.URL - top, *s = (*s)[0], (*s)[1:] - return top -} - -func (s *urlStack) top() *url.URL { - if s == nil || len(*s) == 0 { - return nil - } - return (*s)[0] -} - -type XMLBase struct { - stack urlStack - URIAttrs map[string]bool -} - -// FindRoot iterates through the tokens of an xml document until -// it encounters its first StartTag event. It returns an error -// if it reaches EndDocument before finding a tag. -func (b *XMLBase) FindRoot(p *xpp.XMLPullParser) (event xpp.XMLEventType, err error) { - for { - event, err = b.NextTag(p) - if err != nil { - return event, err - } - if event == xpp.StartTag { - break - } - - if event == xpp.EndDocument { - return event, fmt.Errorf("Failed to find root node before document end.") - } - } - return -} +) // XMLBase.NextTag iterates through the tokens until it reaches a StartTag or -// EndTag It maintains the urlStack upon encountering StartTag and EndTags, so -// that the top of the stack (accessible through the CurrentBase() and -// CurrentBaseURL() methods) is the absolute base URI by which relative URIs -// should be resolved. +// EndTag. It resolves urls in tag attributes relative to the current xml:base. // // NextTag is similar to goxpp's NextTag method except it wont throw an error // if the next immediate token isnt a Start/EndTag. Instead, it will continue // to consume tokens until it hits a Start/EndTag or EndDocument. -func (b *XMLBase) NextTag(p *xpp.XMLPullParser) (event xpp.XMLEventType, err error) { +func NextTag(p *xpp.XMLPullParser) (event xpp.XMLEventType, err error) { for { - - if p.Event == xpp.EndTag { - // Pop xml:base after each end tag - b.pop() - } - event, err = p.Next() if err != nil { return event, err @@ -105,13 +58,11 @@ func (b *XMLBase) NextTag(p *xpp.XMLPullParser) (event xpp.XMLEventType, err err } if event == xpp.StartTag { - base := parseBase(p) - err = b.push(base) if err != nil { return } - err = b.resolveAttrs(p) + err = resolveAttrs(p) if err != nil { return } @@ -127,80 +78,18 @@ func (b *XMLBase) NextTag(p *xpp.XMLPullParser) (event xpp.XMLEventType, err err return } -func parseBase(p *xpp.XMLPullParser) string { - xmlURI := "http://www.w3.org/XML/1998/namespace" - for _, attr := range p.Attrs { - if attr.Name.Local == "base" && attr.Name.Space == xmlURI { - return attr.Value - } - } - return "" -} - -func (b *XMLBase) push(base string) error { - newURL, err := url.Parse(base) - if err != nil { - return err - } - - topURL := b.CurrentBaseURL() - if topURL != nil { - newURL = topURL.ResolveReference(newURL) - } - b.stack.push(newURL) - return nil -} - -// returns the popped base URL -func (b *XMLBase) pop() string { - url := b.stack.pop() - if url != nil { - return url.String() - } - return "" -} - -func (b *XMLBase) CurrentBaseURL() *url.URL { - return b.stack.top() -} - -func (b *XMLBase) CurrentBase() string { - if url := b.CurrentBaseURL(); url != nil { - return url.String() - } - return "" -} - -// resolve the given string as a URL relative to current base -func (b *XMLBase) ResolveURL(u string) (string, error) { - if b.CurrentBase() == "" { - return u, nil - } - - relURL, err := url.Parse(u) - if err != nil { - return u, err - } - curr := b.CurrentBaseURL() - if curr.Path != "" && u != "" && curr.Path[len(curr.Path)-1] != '/' { - // There's no reason someone would use a path in xml:base if they - // didn't mean for it to be a directory - curr.Path = curr.Path + "/" - } - absURL := b.CurrentBaseURL().ResolveReference(relURL) - return absURL.String(), nil -} - // resolve relative URI attributes according to xml:base -func (b *XMLBase) resolveAttrs(p *xpp.XMLPullParser) error { +func resolveAttrs(p *xpp.XMLPullParser) error { for i, attr := range p.Attrs { lowerName := strings.ToLower(attr.Name.Local) - if b.URIAttrs[lowerName] { - absURL, err := b.ResolveURL(attr.Value) + if uriAttrs[lowerName] { + absURL, err := p.XmlBaseResolveUrl(attr.Value) if err != nil { return err } - p.Attrs[i].Value = absURL + if absURL != nil { + p.Attrs[i].Value = absURL.String() + } } } return nil @@ -209,8 +98,8 @@ func (b *XMLBase) resolveAttrs(p *xpp.XMLPullParser) error { // Transforms html by resolving any relative URIs in attributes // if an error occurs during parsing or serialization, then the original string // is returned along with the error. -func (b *XMLBase) ResolveHTML(relHTML string) (string, error) { - if b.CurrentBase() == "" { +func ResolveHTML(p *xpp.XMLPullParser, relHTML string) (string, error) { + if p.BaseStack.Top() == nil { return relHTML, nil } @@ -228,9 +117,9 @@ func (b *XMLBase) ResolveHTML(relHTML string) (string, error) { if n.Type == html.ElementNode { for i, a := range n.Attr { if htmlURIAttrs[a.Key] { - absVal, err := b.ResolveURL(a.Val) - if err == nil { - n.Attr[i].Val = absVal + absVal, err := p.XmlBaseResolveUrl(a.Val) + if absVal != nil && err == nil { + n.Attr[i].Val = absVal.String() } break } diff --git a/vendor/github.com/mmcdole/gofeed/rss/parser.go b/vendor/github.com/mmcdole/gofeed/rss/parser.go index a807853..61e3fbd 100644 --- a/vendor/github.com/mmcdole/gofeed/rss/parser.go +++ b/vendor/github.com/mmcdole/gofeed/rss/parser.go @@ -11,16 +11,13 @@ import ( ) // Parser is a RSS Parser -type Parser struct { - base *shared.XMLBase -} +type Parser struct{} // Parse parses an xml feed into an rss.Feed func (rp *Parser) Parse(feed io.Reader) (*Feed, error) { p := xpp.NewXMLPullParser(feed, false, shared.NewReaderLabel) - rp.base = &shared.XMLBase{} - _, err := rp.base.FindRoot(p) + _, err := shared.FindRoot(p) if err != nil { return nil, err } @@ -44,7 +41,7 @@ func (rp *Parser) parseRoot(p *xpp.XMLPullParser) (*Feed, error) { ver := rp.parseVersion(p) for { - tok, err := rp.base.NextTag(p) + tok, err := shared.NextTag(p) if err != nil { return nil, err } @@ -130,7 +127,7 @@ func (rp *Parser) parseChannel(p *xpp.XMLPullParser) (rss *Feed, err error) { links := []string{} for { - tok, err := rp.base.NextTag(p) + tok, err := shared.NextTag(p) if err != nil { return nil, err } @@ -327,7 +324,7 @@ func (rp *Parser) parseItem(p *xpp.XMLPullParser) (item *Item, err error) { links := []string{} for { - tok, err := rp.base.NextTag(p) + tok, err := shared.NextTag(p) if err != nil { return nil, err } @@ -529,7 +526,7 @@ func (rp *Parser) parseImage(p *xpp.XMLPullParser) (image *Image, err error) { image = &Image{} for { - tok, err := rp.base.NextTag(p) + tok, err := shared.NextTag(p) if err != nil { return image, err } @@ -640,7 +637,7 @@ func (rp *Parser) parseTextInput(p *xpp.XMLPullParser) (*TextInput, error) { ti := &TextInput{} for { - tok, err := rp.base.NextTag(p) + tok, err := shared.NextTag(p) if err != nil { return nil, err } @@ -697,7 +694,7 @@ func (rp *Parser) parseSkipHours(p *xpp.XMLPullParser) ([]string, error) { hours := []string{} for { - tok, err := rp.base.NextTag(p) + tok, err := shared.NextTag(p) if err != nil { return nil, err } @@ -735,7 +732,7 @@ func (rp *Parser) parseSkipDays(p *xpp.XMLPullParser) ([]string, error) { days := []string{} for { - tok, err := rp.base.NextTag(p) + tok, err := shared.NextTag(p) if err != nil { return nil, err } @@ -777,7 +774,7 @@ func (rp *Parser) parseCloud(p *xpp.XMLPullParser) (*Cloud, error) { cloud.RegisterProcedure = p.Attribute("registerProcedure") cloud.Protocol = p.Attribute("protocol") - rp.base.NextTag(p) + shared.NextTag(p) if err := p.Expect(xpp.EndTag, "cloud"); err != nil { return nil, err diff --git a/vendor/github.com/mmcdole/goxpp/xpp.go b/vendor/github.com/mmcdole/goxpp/xpp.go index a319468..ae4d135 100644 --- a/vendor/github.com/mmcdole/goxpp/xpp.go +++ b/vendor/github.com/mmcdole/goxpp/xpp.go @@ -5,12 +5,15 @@ import ( "errors" "fmt" "io" + "net/url" "strings" ) type XMLEventType int type CharsetReader func(charset string, input io.Reader) (io.Reader, error) +const xmlNSURI = "http://www.w3.org/XML/1998/namespace" + const ( StartDocument XMLEventType = iota EndDocument @@ -24,10 +27,33 @@ const ( // TODO: CDSECT ? ) +type urlStack []*url.URL + +func (s *urlStack) push(u *url.URL) { + *s = append([]*url.URL{u}, *s...) +} + +func (s *urlStack) pop() *url.URL { + if s == nil || len(*s) == 0 { + return nil + } + var top *url.URL + top, *s = (*s)[0], (*s)[1:] + return top +} + +func (s *urlStack) Top() *url.URL { + if s == nil || len(*s) == 0 { + return nil + } + return (*s)[0] +} + type XMLPullParser struct { // Document State Spaces map[string]string SpacesStack []map[string]string + BaseStack urlStack // Token State Depth int @@ -214,6 +240,7 @@ func (p *XMLPullParser) DecodeElement(v interface{}) error { p.Depth-- p.Name = name p.token = nil + p.popBase() return nil } @@ -263,6 +290,26 @@ func (p *XMLPullParser) EventType(t xml.Token) (event XMLEventType) { return } +// resolve the given string as a URL relative to current xml:base +func (p *XMLPullParser) XmlBaseResolveUrl(u string) (*url.URL, error) { + curr := p.BaseStack.Top() + if curr == nil { + return nil, nil + } + + relURL, err := url.Parse(u) + if err != nil { + return nil, err + } + if curr.Path != "" && u != "" && curr.Path[len(curr.Path)-1] != '/' { + // There's no reason someone would use a path in xml:base if they + // didn't mean for it to be a directory + curr.Path = curr.Path + "/" + } + absURL := curr.ResolveReference(relURL) + return absURL, nil +} + func (p *XMLPullParser) processToken(t xml.Token) { switch tt := t.(type) { case xml.StartElement: @@ -286,6 +333,7 @@ func (p *XMLPullParser) processStartToken(t xml.StartElement) { p.Name = t.Name.Local p.Space = t.Name.Space p.trackNamespaces(t) + p.pushBase() } func (p *XMLPullParser) processEndToken(t xml.EndElement) { @@ -297,6 +345,7 @@ func (p *XMLPullParser) processEndToken(t xml.EndElement) { p.Spaces = p.SpacesStack[len(p.SpacesStack)-1] } p.Name = t.Name.Local + p.popBase() } func (p *XMLPullParser) processCharDataToken(t xml.CharData) { @@ -340,3 +389,40 @@ func (p *XMLPullParser) trackNamespaces(t xml.StartElement) { p.Spaces = newSpace p.SpacesStack = append(p.SpacesStack, newSpace) } + +// returns the popped base URL +func (p *XMLPullParser) popBase() string { + url := p.BaseStack.pop() + if url != nil { + return url.String() + } + return "" +} + +// Searches current attributes for xml:base and updates the urlStack +func (p *XMLPullParser) pushBase() error { + var base string + // search list of attrs for "xml:base" + for _, attr := range p.Attrs { + if attr.Name.Local == "base" && attr.Name.Space == xmlNSURI { + base = attr.Value + break + } + } + if base == "" { + // no base attribute found + return nil + } + + newURL, err := url.Parse(base) + if err != nil { + return err + } + + topURL := p.BaseStack.Top() + if topURL != nil { + newURL = topURL.ResolveReference(newURL) + } + p.BaseStack.push(newURL) + return nil +} diff --git a/vendor/github.com/sirupsen/logrus/README.md b/vendor/github.com/sirupsen/logrus/README.md index b042c89..d1d4a85 100644 --- a/vendor/github.com/sirupsen/logrus/README.md +++ b/vendor/github.com/sirupsen/logrus/README.md @@ -9,7 +9,7 @@ the last thing you want from your Logging library (again...). This does not mean Logrus is dead. Logrus will continue to be maintained for security, (backwards compatible) bug fixes, and performance (where we are -limited by the interface). +limited by the interface). I believe Logrus' biggest contribution is to have played a part in today's widespread use of structured logging in Golang. There doesn't seem to be a @@ -43,7 +43,7 @@ plain text): With `log.SetFormatter(&log.JSONFormatter{})`, for easy parsing by logstash or Splunk: -```json +```text {"animal":"walrus","level":"info","msg":"A group of walrus emerges from the ocean","size":10,"time":"2014-03-10 19:57:38.562264131 -0400 EDT"} @@ -99,7 +99,7 @@ time="2015-03-26T01:27:38-04:00" level=fatal method=github.com/sirupsen/arcticcr ``` Note that this does add measurable overhead - the cost will depend on the version of Go, but is between 20 and 40% in recent tests with 1.6 and 1.7. You can validate this in your -environment via benchmarks: +environment via benchmarks: ``` go test -bench=.*CallerTracing ``` @@ -317,6 +317,8 @@ log.SetLevel(log.InfoLevel) It may be useful to set `log.Level = logrus.DebugLevel` in a debug or verbose environment if your application has that. +Note: If you want different log levels for global (`log.SetLevel(...)`) and syslog logging, please check the [syslog hook README](hooks/syslog/README.md#different-log-levels-for-local-and-remote-logging). + #### Entries Besides the fields added with `WithField` or `WithFields` some fields are diff --git a/vendor/github.com/sirupsen/logrus/writer.go b/vendor/github.com/sirupsen/logrus/writer.go index 72e8e3a..074fd4b 100644 --- a/vendor/github.com/sirupsen/logrus/writer.go +++ b/vendor/github.com/sirupsen/logrus/writer.go @@ -4,6 +4,7 @@ import ( "bufio" "io" "runtime" + "strings" ) // Writer at INFO level. See WriterLevel for details. @@ -20,15 +21,18 @@ func (logger *Logger) WriterLevel(level Level) *io.PipeWriter { return NewEntry(logger).WriterLevel(level) } +// Writer returns an io.Writer that writes to the logger at the info log level func (entry *Entry) Writer() *io.PipeWriter { return entry.WriterLevel(InfoLevel) } +// WriterLevel returns an io.Writer that writes to the logger at the given log level func (entry *Entry) WriterLevel(level Level) *io.PipeWriter { reader, writer := io.Pipe() var printFunc func(args ...interface{}) + // Determine which log function to use based on the specified log level switch level { case TraceLevel: printFunc = entry.Trace @@ -48,23 +52,51 @@ func (entry *Entry) WriterLevel(level Level) *io.PipeWriter { printFunc = entry.Print } + // Start a new goroutine to scan the input and write it to the logger using the specified print function. + // It splits the input into chunks of up to 64KB to avoid buffer overflows. go entry.writerScanner(reader, printFunc) + + // Set a finalizer function to close the writer when it is garbage collected runtime.SetFinalizer(writer, writerFinalizer) return writer } +// writerScanner scans the input from the reader and writes it to the logger func (entry *Entry) writerScanner(reader *io.PipeReader, printFunc func(args ...interface{})) { scanner := bufio.NewScanner(reader) + + // Set the buffer size to the maximum token size to avoid buffer overflows + scanner.Buffer(make([]byte, bufio.MaxScanTokenSize), bufio.MaxScanTokenSize) + + // Define a split function to split the input into chunks of up to 64KB + chunkSize := bufio.MaxScanTokenSize // 64KB + splitFunc := func(data []byte, atEOF bool) (int, []byte, error) { + if len(data) >= chunkSize { + return chunkSize, data[:chunkSize], nil + } + + return bufio.ScanLines(data, atEOF) + } + + // Use the custom split function to split the input + scanner.Split(splitFunc) + + // Scan the input and write it to the logger using the specified print function for scanner.Scan() { - printFunc(scanner.Text()) + printFunc(strings.TrimRight(scanner.Text(), "\r\n")) } + + // If there was an error while scanning the input, log an error if err := scanner.Err(); err != nil { entry.Errorf("Error while reading from Writer: %s", err) } + + // Close the reader when we are done reader.Close() } +// WriterFinalizer is a finalizer function that closes then given writer when it is garbage collected func writerFinalizer(writer *io.PipeWriter) { writer.Close() } diff --git a/vendor/golang.org/x/net/html/doc.go b/vendor/golang.org/x/net/html/doc.go index 822ed42..2466ae3 100644 --- a/vendor/golang.org/x/net/html/doc.go +++ b/vendor/golang.org/x/net/html/doc.go @@ -92,6 +92,27 @@ example, to process each anchor node in depth-first order: The relevant specifications include: https://html.spec.whatwg.org/multipage/syntax.html and https://html.spec.whatwg.org/multipage/syntax.html#tokenization + +# Security Considerations + +Care should be taken when parsing and interpreting HTML, whether full documents +or fragments, within the framework of the HTML specification, especially with +regard to untrusted inputs. + +This package provides both a tokenizer and a parser, which implement the +tokenization, and tokenization and tree construction stages of the WHATWG HTML +parsing specification respectively. While the tokenizer parses and normalizes +individual HTML tokens, only the parser constructs the DOM tree from the +tokenized HTML, as described in the tree construction stage of the +specification, dynamically modifying or extending the docuemnt's DOM tree. + +If your use case requires semantically well-formed HTML documents, as defined by +the WHATWG specification, the parser should be used rather than the tokenizer. + +In security contexts, if trust decisions are being made using the tokenized or +parsed content, the input must be re-serialized (for instance by using Render or +Token.String) in order for those trust decisions to hold, as the process of +tokenization or parsing may alter the content. */ package html // import "golang.org/x/net/html" diff --git a/vendor/golang.org/x/net/html/escape.go b/vendor/golang.org/x/net/html/escape.go index d856139..04c6bec 100644 --- a/vendor/golang.org/x/net/html/escape.go +++ b/vendor/golang.org/x/net/html/escape.go @@ -193,6 +193,87 @@ func lower(b []byte) []byte { return b } +// escapeComment is like func escape but escapes its input bytes less often. +// Per https://github.com/golang/go/issues/58246 some HTML comments are (1) +// meaningful and (2) contain angle brackets that we'd like to avoid escaping +// unless we have to. +// +// "We have to" includes the '&' byte, since that introduces other escapes. +// +// It also includes those bytes (not including EOF) that would otherwise end +// the comment. Per the summary table at the bottom of comment_test.go, this is +// the '>' byte that, per above, we'd like to avoid escaping unless we have to. +// +// Studying the summary table (and T actions in its '>' column) closely, we +// only need to escape in states 43, 44, 49, 51 and 52. State 43 is at the +// start of the comment data. State 52 is after a '!'. The other three states +// are after a '-'. +// +// Our algorithm is thus to escape every '&' and to escape '>' if and only if: +// - The '>' is after a '!' or '-' (in the unescaped data) or +// - The '>' is at the start of the comment data (after the opening ""); err != nil { @@ -194,9 +194,8 @@ func render1(w writer, n *Node) error { } } - // Render any child nodes. - switch n.Data { - case "iframe", "noembed", "noframes", "noscript", "plaintext", "script", "style", "xmp": + // Render any child nodes + if childTextNodesAreLiteral(n) { for c := n.FirstChild; c != nil; c = c.NextSibling { if c.Type == TextNode { if _, err := w.WriteString(c.Data); err != nil { @@ -213,7 +212,7 @@ func render1(w writer, n *Node) error { // last element in the file, with no closing tag. return plaintextAbort } - default: + } else { for c := n.FirstChild; c != nil; c = c.NextSibling { if err := render1(w, c); err != nil { return err @@ -231,6 +230,27 @@ func render1(w writer, n *Node) error { return w.WriteByte('>') } +func childTextNodesAreLiteral(n *Node) bool { + // Per WHATWG HTML 13.3, if the parent of the current node is a style, + // script, xmp, iframe, noembed, noframes, or plaintext element, and the + // current node is a text node, append the value of the node's data + // literally. The specification is not explicit about it, but we only + // enforce this if we are in the HTML namespace (i.e. when the namespace is + // ""). + // NOTE: we also always include noscript elements, although the + // specification states that they should only be rendered as such if + // scripting is enabled for the node (which is not something we track). + if n.Namespace != "" { + return false + } + switch n.Data { + case "iframe", "noembed", "noframes", "noscript", "plaintext", "script", "style", "xmp": + return true + default: + return false + } +} + // writeQuoted writes s to w surrounded by quotes. Normally it will use double // quotes, but if s contains a double quote, it will use single quotes. // It is used for writing the identifiers in a doctype declaration. diff --git a/vendor/golang.org/x/net/html/token.go b/vendor/golang.org/x/net/html/token.go index 50f7c6a..de67f93 100644 --- a/vendor/golang.org/x/net/html/token.go +++ b/vendor/golang.org/x/net/html/token.go @@ -110,7 +110,7 @@ func (t Token) String() string { case SelfClosingTagToken: return "<" + t.tagString() + "/>" case CommentToken: - return "" + return "" case DoctypeToken: return "" } @@ -598,10 +598,10 @@ scriptDataDoubleEscapeEnd: // readComment reads the next comment token starting with "