Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add deprecation notice interface #399

Merged
merged 4 commits into from
Nov 13, 2021
Merged

feat: add deprecation notice interface #399

merged 4 commits into from
Nov 13, 2021

Conversation

caarlos0
Copy link
Member

as discussed in another issue

this would allow, for example, goreleaser, to set its own deprecation notice "provider" to nfpm...

@caarlos0 caarlos0 added the enhancement New feature or request label Nov 12, 2021
@caarlos0 caarlos0 self-assigned this Nov 12, 2021
@caarlos0 caarlos0 added this to In progress in Board via automation Nov 12, 2021
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 12, 2021
@codecov
Copy link

codecov bot commented Nov 12, 2021

Codecov Report

Merging #399 (d0b3618) into main (5e665bd) will increase coverage by 0.15%.
The diff coverage is 81.81%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #399      +/-   ##
==========================================
+ Coverage   65.25%   65.40%   +0.15%     
==========================================
  Files          14       15       +1     
  Lines        1842     1850       +8     
==========================================
+ Hits         1202     1210       +8     
  Misses        502      502              
  Partials      138      138              
Impacted Files Coverage Δ
nfpm.go 80.72% <0.00%> (ø)
deb/deb.go 68.90% <100.00%> (ø)
deprecation/deprecation.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5e665bd...d0b3618. Read the comment docs.

@erikgeiser
Copy link
Member

erikgeiser commented Nov 12, 2021

I intuition tells me to simplify it. What's the advantage compared to this?

var DeprecationNoticeWriter io.Writer = os.Stderr

 // Notice will notice a deprecation with the previously set noticer.
func Notice(s string) {
     DeprecationNoticeWriter.Write(s)
 }

func Noticef(format string, a ...interface{}) {
    fmt.Fprintf(DeprecationNoticeWriter, format, a...)
}

@caarlos0
Copy link
Member Author

on my impl it would be easier to use, say, a logger library... but its fair, the caller can always implement a simple writer that logs...

will change it :)

@vercel vercel bot temporarily deployed to Preview November 12, 2021 21:08 Inactive
@vercel vercel bot temporarily deployed to Preview November 12, 2021 21:13 Inactive
@caarlos0 caarlos0 merged commit 2a86957 into main Nov 13, 2021
Board automation moved this from In progress to Done Nov 13, 2021
@caarlos0 caarlos0 deleted the deprecation branch November 13, 2021 02:07
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
No open projects
Board
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants