{"id":13409804,"url":"https://github.com/mingrammer/cfmt","last_synced_at":"2025-04-22T16:31:13.142Z","repository":{"id":49325913,"uuid":"125414082","full_name":"mingrammer/cfmt","owner":"mingrammer","description":":art: Contextual fmt inspired by bootstrap color classes","archived":false,"fork":false,"pushed_at":"2018-12-07T17:31:52.000Z","size":39,"stargazers_count":102,"open_issues_count":1,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-07-31T20:38:29.807Z","etag":null,"topics":["bootstrap","contextual","fmt","go"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mingrammer.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}},"created_at":"2018-03-15T19:04:27.000Z","updated_at":"2024-05-10T11:35:56.000Z","dependencies_parsed_at":"2022-09-26T19:52:46.814Z","dependency_job_id":null,"html_url":"https://github.com/mingrammer/cfmt","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingrammer%2Fcfmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingrammer%2Fcfmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingrammer%2Fcfmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingrammer%2Fcfmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mingrammer","download_url":"https://codeload.github.com/mingrammer/cfmt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223900316,"owners_count":17222028,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bootstrap","contextual","fmt","go"],"created_at":"2024-07-30T20:01:03.465Z","updated_at":"2024-11-10T00:40:32.005Z","avatar_url":"https://github.com/mingrammer.png","language":"Go","readme":"\u003cbr\u003e\u003cbr\u003e\n\n\u003ch1 align=\"center\"\u003eCfmt\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://godoc.org/github.com/mingrammer/cfmt\"\u003e\u003cimg src=\"https://godoc.org/github.com/mingrammer/cfmt?status.svg\"/\u003e\n  \u003ca href=\"https://goreportcard.com/report/github.com/mingrammer/cfmt\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/mingrammer/cfmt\"/\u003e\u003c/a\u003e\n\u003c/a\u003e\n  \u003ca href=\"https://travis-ci.org/mingrammer/cfmt\"\u003e\u003cimg src=\"https://travis-ci.org/mingrammer/cfmt.svg?branch=master\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/mingrammer/cfmt\"\u003e\u003cimg src=\"https://codecov.io/gh/mingrammer/cfmt/branch/master/graph/badge.svg\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e Contextual fmt \u003c/p\u003e\n\n\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\n\nIt provides contextual formatting functions that have nearly identical usage of the fmt package. The ideas were borrowed from bootstrap's contextual color classes.\n\n## Installation\n\n```\ngo get github.com/mingrammer/cfmt\n```\n\n## Usage\n\n```go\npackage main\n\nimport (\n    \"log\"\n\n    \"github.com/mingrammer/cfmt\"\n)\n\nfunc main() {\n    cfmt.Success(\"User was created successfully\")\n    cfmt.Infoln(\"Here are some candidates\")\n    cfmt.Warningf(\"%s is not valid integer value\\n\", \"123a\")\n    log.Fatal(cfmt.Serrorf(\"Only numeric is allowed, got %s\", \"123.456a\"))\n}\n```\n\n![cfmt output](images/output.png)\n\n## Contextual functions\n\n\u003e Note: cfmt.Errorf function does not do same things to fmt.Errorf, but to fmt.Printf with red colored text.\n\n- Success (Green)\n  - Fsuccess, Fsuccessf, Fsuccessln\n  - Success, Successf, Successln\n  - Ssuccess, Ssuccessf, Ssuccessln\n- Info (Cyan)\n  - Finfo, Finfof, Finfoln\n  - Info, Infof, Infoln\n  - Sinfo, Sinfof, Sinfoln\n- Warning (Yellow)\n  - Fwarning, Fwarningf, Fwarningln\n  - Warning, Warningf, Warningln\n  - Swarning, Swarningf, Swarningln\n- Error (Red)\n  - Ferror, Ferrorf, Ferrorln\n  - Error, Errorf, Errorln\n  - Serror, Serrorf, Serrorln\n\n## License\n\nMIT\n","funding_links":[],"categories":["Command Line","命令行","Go","高级控制台UI","高级控制台UI`用于构建控制台应用程序和控制台用户界面的库.`","Build Automation"],"sub_categories":["Advanced Console UIs","高级控制台用户界面","标准 CLI"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmingrammer%2Fcfmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmingrammer%2Fcfmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmingrammer%2Fcfmt/lists"}