[PR #1406] [MERGED] refactor: use slices.Contains to simplify code #1597

Closed
opened 2026-05-07 01:02:50 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/binwiederhier/ntfy/pull/1406
Author: @tanhuaan
Created: 7/30/2025
Status: Merged
Merged: 2/1/2026
Merged by: @binwiederhier

Base: mainHead: main


📝 Commits (1)

  • 0e79c4b refactor: use slices.Contains to simplify code

📊 Changes

2 files changed (+4 additions, -12 deletions)

View changed files

📝 util/sprig/defaults.go (+2 -6)
📝 util/util.go (+2 -6)

📄 Description

There is a new function added in the go1.21 standard library, which can make the code more concise and easy to read.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/binwiederhier/ntfy/pull/1406 **Author:** [@tanhuaan](https://github.com/tanhuaan) **Created:** 7/30/2025 **Status:** ✅ Merged **Merged:** 2/1/2026 **Merged by:** [@binwiederhier](https://github.com/binwiederhier) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`0e79c4b`](https://github.com/binwiederhier/ntfy/commit/0e79c4bd2a4ae314daa340fc37daa1160709b740) refactor: use slices.Contains to simplify code ### 📊 Changes **2 files changed** (+4 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `util/sprig/defaults.go` (+2 -6) 📝 `util/util.go` (+2 -6) </details> ### 📄 Description There is a [new function](https://pkg.go.dev/slices@go1.21.0#Contains) added in the go1.21 standard library, which can make the code more concise and easy to read. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 01:02:50 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#1597
No description provided.