Update dependencies and build to go1.22 (#2113)

* Update dependencies and build to go1.22

* Fix api changes wrt to dependencies

* Update golangci config
This commit is contained in:
Wim
2024-05-23 23:44:31 +02:00
committed by GitHub
parent 56e7bd01ca
commit 2f33fe86f5
1556 changed files with 3279522 additions and 1924375 deletions

View File

@@ -62,7 +62,6 @@ linters:
- godot # checks if comments end in a period
- godox # detects FIXME, TODO and other comment keywords
- goimports # in addition to fixing imports, goimports also formats your code in the same style as gofmt
- gomnd # detects magic numbers
- gomoddirectives # manages the use of 'replace', 'retract', and 'excludes' directives in go.mod
- gomodguard # allow and block lists linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations
- goprintffuncname # checks that printf-like functions are named with f at the end
@@ -99,6 +98,7 @@ linters:
- whitespace # detects leading and trailing whitespace
# disabled for now:
# - gomnd # detects magic numbers
# - errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error
# - gochecknoglobals # checks that no global variables exist
# - gocognit # computes and checks the cognitive complexity of functions
@@ -150,19 +150,19 @@ linters-settings:
# Whether to skip (*x).method() calls where x is a pointer receiver.
skipRecvDeref: false
gomnd:
# Values always ignored: `time.Date`,
# `strconv.FormatInt`, `strconv.FormatUint`, `strconv.FormatFloat`,
# `strconv.ParseInt`, `strconv.ParseUint`, `strconv.ParseFloat`.
ignored-functions:
- os.Chmod
- os.Mkdir
- os.MkdirAll
- os.OpenFile
- os.WriteFile
- prometheus.ExponentialBuckets
- prometheus.ExponentialBucketsRange
- prometheus.LinearBuckets
# gomnd:
# # Values always ignored: `time.Date`,
# # `strconv.FormatInt`, `strconv.FormatUint`, `strconv.FormatFloat`,
# # `strconv.ParseInt`, `strconv.ParseUint`, `strconv.ParseFloat`.
# ignored-functions:
# - os.Chmod
# - os.Mkdir
# - os.MkdirAll
# - os.OpenFile
# - os.WriteFile
# - prometheus.ExponentialBuckets
# - prometheus.ExponentialBucketsRange
# - prometheus.LinearBuckets
gomodguard:
blocked:

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2016 Liam Stanley <me@liamstanley.io>
Copyright (c) 2016 Liam Stanley <liam@liam.sh>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -93,6 +93,8 @@ usecases/examples/projects which utilize girc:
| [nagios-check-ircd](https://github.com/lrstanley/nagios-check-ircd) | Nagios utility for monitoring the health of an ircd |
| [nagios-notify-irc](https://github.com/lrstanley/nagios-notify-irc) | Nagios utility for sending alerts to one or many channels/networks |
| [matterbridge](https://github.com/42wim/matterbridge) | bridge between mattermost, IRC, slack, discord (and many others) with REST API |
| [milla](https://github.com/terminaldweller/milla) | An LLM bot with syntax Highlighting |
| [hii](https://github.com/nmeum/hii) | A file-based IRC client |
Working on a project and want to add it to the list? Submit a pull request!

View File

@@ -312,11 +312,7 @@ func New(config Config) *Client {
// the event can't be sent within 30s.
func (c *Client) receive(e *Event) {
t := time.NewTimer(30 * time.Second)
defer func() {
if !t.Stop() {
<-t.C
}
}()
defer t.Stop()
select {
case c.rx <- e:

View File

@@ -150,35 +150,24 @@ type decodedEvent struct {
}
func (c *ircConn) decode() <-chan decodedEvent {
ch := make(chan decodedEvent)
ch := make(chan decodedEvent, 1)
go func() {
defer close(ch)
line, err := c.io.ReadString(delim)
if err != nil {
select {
case ch <- decodedEvent{err: err}:
default:
}
ch <- decodedEvent{err: err}
return
}
event := ParseEvent(line)
if event == nil {
select {
case ch <- decodedEvent{err: ErrParseEvent{Line: line}}:
default:
}
ch <- decodedEvent{err: ErrParseEvent{Line: line}}
return
}
select {
case ch <- decodedEvent{event: event}:
default:
}
ch <- decodedEvent{event: event}
}()
return ch
@@ -497,11 +486,7 @@ func (c *Client) write(event *Event) {
}
t := time.NewTimer(30 * time.Second)
defer func() {
if !t.Stop() {
<-t.C
}
}()
defer t.Stop()
select {
case c.tx <- event: