MCPcopy Index your code
hub / github.com/devopsctl/gitlabctl / printFlagsTable

Function printFlagsTable

cmd/helpers_for_test.go:183–203  ·  view source on GitHub ↗
(flagsMap map[string]string, c string)

Source from the content-addressed store, hash-verified

181}
182
183func printFlagsTable(flagsMap map[string]string, c string) string {
184 buff := new(bytes.Buffer)
185 header := []string{"FLAGS", "VALUE"}
186 table := tablewriter.NewWriter(buff)
187 table.SetHeader(header)
188 for k, v := range flagsMap {
189 table.Append([]string{k, v})
190 }
191
192 headerColor := tablewriter.Colors{
193 tablewriter.Bold, tablewriter.BgGreenColor}
194 table.SetHeaderColor(headerColor, headerColor)
195 table.SetColumnColor(tablewriter.Colors{
196 tablewriter.Bold, tablewriter.FgHiRedColor},
197 tablewriter.Colors{
198 tablewriter.Bold, tablewriter.FgHiBlackColor})
199
200 table.SetCaption(true, c)
201 table.Render()
202 return buff.String()
203}
204
205func assertEqualResult(t *testing.T, got, want testResult, msg string) {
206 if got != want {

Callers 15

TestGetProjectsFunction · 0.85
TestDescBranchCmdFunction · 0.85
TestGetMembersFunction · 0.85
TestNewUserFunction · 0.85
TestProtectBranchFunction · 0.85
TestGetUsersFunction · 0.85
TestEditProjectFunction · 0.85
TestEditUserFunction · 0.85
TestDeleteTagCmdFunction · 0.85
TestGenCodeCmdFunction · 0.85
TestGetProjectHooksFunction · 0.85
TestNewGroupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected