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

Stringer #32

Merged
merged 3 commits into from
Apr 10, 2024
Merged

Stringer #32

merged 3 commits into from
Apr 10, 2024

Conversation

david-littlefarmer
Copy link
Collaborator

Description

Solution for #29
Added string from String() next to element, only when the printed string is different from original value.

Added * for pointers at primitive types.

image

Checklist

  • Code compiles correctly
  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary

@violin0622
Copy link
Contributor

What if the String() method returns a really really long string that exceeds the terminal width ?
will it break the indentation?
Maybe it's better to truncate the string when it's too long.

@david-littlefarmer
Copy link
Collaborator Author

The indentation is dependent on \n in strings
Custom stringer on string can't be done, because of recursion (so far i know).
I think i can leave it as it is now or i can add option flag if this should be printed at all.

@violin0622
Copy link
Contributor

Is there updates on the PR ?

@david-littlefarmer
Copy link
Collaborator Author

Nope. I'll merge it. Sorry i didn't had any time for this for a few last months.

@david-littlefarmer david-littlefarmer merged commit 4299e8a into master Apr 10, 2024
1 check passed
@david-littlefarmer david-littlefarmer deleted the stringer branch April 10, 2024 12:14
@ghostiam ghostiam mentioned this pull request Jun 26, 2024
4 tasks
renovate bot referenced this pull request in jippi/dottie Aug 19, 2024
….mod (#80)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [github.com/golang-cz/devslog](https://togithub.com/golang-cz/devslog)
| `v0.0.8` -> `v0.0.9` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fgolang-cz%2fdevslog/v0.0.9?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fgolang-cz%2fdevslog/v0.0.9?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fgolang-cz%2fdevslog/v0.0.8/v0.0.9?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fgolang-cz%2fdevslog/v0.0.8/v0.0.9?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>golang-cz/devslog (github.com/golang-cz/devslog)</summary>

###
[`v0.0.9`](https://togithub.com/golang-cz/devslog/releases/tag/v0.0.9)

[Compare
Source](https://togithub.com/golang-cz/devslog/compare/v0.0.8...v0.0.9)

#### What's Changed

- Fixed slog.Any does not handle interfaces by
[@&#8203;noppawitt](https://togithub.com/noppawitt) in
[https://github.com/golang-cz/devslog/pull/27](https://togithub.com/golang-cz/devslog/pull/27)
- string indent with new lines by
[@&#8203;david-littlefarmer](https://togithub.com/david-littlefarmer) in
[https://github.com/golang-cz/devslog/pull/24](https://togithub.com/golang-cz/devslog/pull/24)
- ignore unexported fields in struct to avoid panic by
[@&#8203;violin0622](https://togithub.com/violin0622) in
[https://github.com/golang-cz/devslog/pull/31](https://togithub.com/golang-cz/devslog/pull/31)
- color tests by
[@&#8203;david-littlefarmer](https://togithub.com/david-littlefarmer) in
[https://github.com/golang-cz/devslog/pull/33](https://togithub.com/golang-cz/devslog/pull/33)
- Stringer by
[@&#8203;david-littlefarmer](https://togithub.com/david-littlefarmer) in
[https://github.com/golang-cz/devslog/pull/32](https://togithub.com/golang-cz/devslog/pull/32)
- Add Stringer support. Fix
[#&#8203;29](https://togithub.com/golang-cz/devslog/issues/29) by
[@&#8203;ghostiam](https://togithub.com/ghostiam) in
[https://github.com/golang-cz/devslog/pull/34](https://togithub.com/golang-cz/devslog/pull/34)
- Removed equal signs from groups by
[@&#8203;david-littlefarmer](https://togithub.com/david-littlefarmer) in
[https://github.com/golang-cz/devslog/pull/36](https://togithub.com/golang-cz/devslog/pull/36)

#### New Contributors

- [@&#8203;noppawitt](https://togithub.com/noppawitt) made their first
contribution in
[https://github.com/golang-cz/devslog/pull/27](https://togithub.com/golang-cz/devslog/pull/27)
- [@&#8203;violin0622](https://togithub.com/violin0622) made their first
contribution in
[https://github.com/golang-cz/devslog/pull/31](https://togithub.com/golang-cz/devslog/pull/31)
- [@&#8203;ghostiam](https://togithub.com/ghostiam) made their first
contribution in
[https://github.com/golang-cz/devslog/pull/34](https://togithub.com/golang-cz/devslog/pull/34)

**Full Changelog**:
golang-cz/devslog@v0.0.8...v0.0.9

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "* */1 * * *" (UTC), Automerge - At
any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job log](https://developer.mend.io/github/jippi/dottie).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguMjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIl19-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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