{"id":22624894,"url":"https://github.com/galdor/go-pp","last_synced_at":"2026-01-31T15:33:34.455Z","repository":{"id":261110365,"uuid":"882359254","full_name":"galdor/go-pp","owner":"galdor","description":"A flexible Golang pretty printer.","archived":false,"fork":false,"pushed_at":"2024-11-11T13:49:17.000Z","size":380,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T17:58:19.470Z","etag":null,"topics":["debugging","golang","pretty-printer"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/galdor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-02T16:09:34.000Z","updated_at":"2024-11-11T13:49:20.000Z","dependencies_parsed_at":"2024-12-09T00:19:20.084Z","dependency_job_id":"d9c04685-0a5a-4e5b-9d20-89bece67c452","html_url":"https://github.com/galdor/go-pp","commit_stats":null,"previous_names":["galdor/go-pp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/galdor/go-pp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galdor%2Fgo-pp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galdor%2Fgo-pp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galdor%2Fgo-pp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galdor%2Fgo-pp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/galdor","download_url":"https://codeload.github.com/galdor/go-pp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galdor%2Fgo-pp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28946778,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T14:26:55.697Z","status":"ssl_error","status_checked_at":"2026-01-31T14:26:52.545Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debugging","golang","pretty-printer"],"created_at":"2024-12-09T00:18:24.102Z","updated_at":"2026-01-31T15:33:34.421Z","avatar_url":"https://github.com/galdor.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-pp\n## Introduction\nThe go-pp library —\"pp\" being for \"pretty printer\"— contains utilities to pretty\nprint Go values. Its main use case is to help debugging. The `%#v` standard\nformatting sequence is fundamentally user hostile: no indentation, prints\npointers instead of recursing, expands values that should not be expanded (e.g.\n`time.Time` values).\n\nThe printing algorithm tries its best to present values in a useful way. Types\nare printed when it makes sense, simple values are displayed inline when\npossible, various standard types have a custom representation.\n\nExample:\n```go\ninfo, _ := os.Stat(\"/dev/stdout\")\np.Print(info, \"standard output\")\n```\n![Output example](misc/standard-output.png)\n\nDebugging is hard. The `pp` package makes it easier.\n\n## Usage\n### Printing values\nImport `go.n16f.net/pp` and call `pp.Print` with any value as argument. Extra\narguments are used as a format string and arguments to add a label to the\noutput.\n\nFor example:\n```go\npp.Print(os.Getenv(\"HOME\"), \"home directory\")\n```\n```\n[command line arguments] []string([\"./test\"])\n```\n\n### Configuring printers\nPrinters can be configured with various settings to match your preferences. The\nfollowing options are available:\n\n- `(*Printer).SetDefaultOutput`: set the output (`io.Writer`) used by the\n  printer for the `Print` method (default: `os.Stdout`).\n- `(*Printer).SetFormatValueFunc`: set the function used to override value\n  formatting. See the section about custom formatting below for more\n  information (default: `pp.FormatValue`)\n- `(*Printer).SetMaxInlineColumn`: set the column beyond which the printer will\n  revert to the normal output format when trying to print a value inline\n  (default: 80).\n- `(*Printer).SetIndent`: set the string used for each indentation level\n  (default: `\"  \"`).\n- `(*Printer).SetLinePrefix`: set a string to be printed at the beginning of\n  each output line.\n- `(*Printer).SetPrintTypes`: control type printing. Can be either:\n  - `pp.PrintTypesDefault`: print the type of values when it is not obvious;\n  - `pp.PrintTypesAlways`: print the type of all values;\n  - `pp.PrintTypesNever`: never print any type.\n- `(*Printer).SetHidePrivateFields`: hide private (non-exported) fields when\n  printing structures.\n- `(*Printer).SetThousandsGroupingMinDigits`: the minimum number of digits for a\n  number to be printed with thousand separators (default: 6).\n- `(*Printer).SetThousandsSeparator`: set the character (rune) used between\n  groups of three digits when printing numbers (default: `'_'`).\n\nYou can either modify the default printer used by `pp.Print`\n(`pp.DefaultPrinter`) or create your own printer.\n\nSee the [`custom-printer` program](examples/custom-printer/main.go) for an\nexample.\n\nPrinters are thread safe.\n\n### Custom formatting\nIt is possible to control the representation of specific types. Use\n`(*Printer).SetFormatValueFunc` to pass your own function.\n\nThe function accept a `reflect.Value` argument and can return an `any` value\nwhich can be either:\n\n- `nil` to use the default printer representation;\n- a value of type `RawString` to print the value as a string without any further\n  formatting (e.g. `RawString(\"foo\")`  will simply print `foo`);\n- any other value to be formatted by the printer.\n\nPrinters will only call this function on values, not pointers.\n\nThe default function, `pp.FormatValue` handles various standard types such as\n`time.Time` or `regexp.Regexp`.\n\nSee the [`custom-formatting` program](examples/custom-formatting/main.go) for an\nexample.\n\n### Documentation\nRefer to the [Go package documentation](https://pkg.go.dev/go.n16f.net/pp)\nfor information about the API.\n\n# Licensing\nGo-pp is open source software distributed under the\n[ISC](https://opensource.org/licenses/ISC) license.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaldor%2Fgo-pp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaldor%2Fgo-pp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaldor%2Fgo-pp/lists"}