mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[PR #4311] [CLOSED] feat: use sprig (slimmed down) for template function map #4961
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#4961
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fatedier/frp/pull/4311
Author: @debdutdeb
Created: 6/30/2024
Status: ❌ Closed
Base:
dev← Head:extend-default-template-functions📝 Commits (1)
7664abbuse sprig (slimmed down) for template function map📊 Changes
3 files changed (+14 additions, -3 deletions)
View changed files
📝
go.mod(+1 -0)📝
go.sum(+2 -0)📝
pkg/config/load.go(+11 -3)📄 Description
WHY
Gives more control over to how we can set our configs.
For example since not everything has an flag cmdline, one could simplify the interface through environment variables instead of editing the config file, manually or automatically.
e.g.
So I can have an function to simplify the interface like
Note
Using
slim-sprigbecause ofAs noted in https://github.com/go-task/slim-sprig
Long term seems like there is an attempt at forking and maintaining separate version - https://github.com/go-sprout/sprout
I can change to sprout as is, but decided to start off with a lightweight version instead. Since still pre major 1, there's still the freedom to experiment.
Let me know whichever you prefer :)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.