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

Change format of zero types #71

Merged
merged 17 commits into from
Nov 5, 2024
Merged

Conversation

yassinebenaid
Copy link
Owner

What is this PR?
= It changes the format of nil maps, slices, functions, pointers and channels

What was changed?

  • Slices:

    var x []int
    var y = make([]int, 0)

    Before:

    []int:0:0 {}
    []int:0:0 {}

    Now:

    []int(nil)
    []int:0:0 {}
  • Maps:

    var x map[string]int
    var y = make(map[string]int)

    Before:

    map[string]int:0 {}
    map[string]int:0 {}

    Now:

    map[string]int(nil)
    map[string]int:0 {}
  • Channels:

    var x chan string
    var y = make(chan string)

    Before:

    chan string
    chan string

    Now:

    chan string(nil)
    chan string
  • Functions:

    var x func()
    var y = func(){}

    Before:

    func()
    func()

    Now:

    func()(nil)
    func()
  • Pointers:

    var x *int
    var y = &x

    Before:

    nil
    &nil

    Now:

    *int(nil)
    &*int(nil)

Why would we need to this?
= Some people like myself are using godump in tests for logging, and we compare two data structures using reflect.DeepEqual(), When comparing a nil slice with a slice of zero length and capacity, they are not equal, but they look the same in logs.

Why there are changes in workflows?
= I don't know, I did a git rebase to solve some issues and I think they caused the 3 first commits not to be recognized in master (hash may have changed).

dependabot bot and others added 10 commits November 3, 2024 16:19
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.5.0 to 4.6.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@e28ff12...b9fd7d1)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6.1.0 to 6.1.1.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](golangci/golangci-lint-action@aaa42aa...971e284)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.0.2 to 5.1.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](actions/setup-go@0a12ed9...41dfa10)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@yassinebenaid yassinebenaid self-assigned this Nov 4, 2024
Copy link

codecov bot commented Nov 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.17%. Comparing base (840b087) to head (ef1fad9).
Report is 18 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #71      +/-   ##
==========================================
+ Coverage   99.07%   99.17%   +0.09%     
==========================================
  Files           1        1              
  Lines         217      243      +26     
==========================================
+ Hits          215      241      +26     
  Misses          2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

dumper.go Outdated Show resolved Hide resolved
ccoVeille
ccoVeille previously approved these changes Nov 5, 2024
Copy link
Collaborator

@ccoVeille ccoVeille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found one last typo,but then it's OK 👍

dumper_test.go Outdated Show resolved Hide resolved
yassinebenaid and others added 3 commits November 5, 2024 10:21
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
@yassinebenaid yassinebenaid merged commit 2c21843 into master Nov 5, 2024
8 checks passed
@yassinebenaid yassinebenaid deleted the change-format-of-zero-types branch November 5, 2024 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants