()
| 41 | ) |
| 42 | |
| 43 | func ExampleNew() { |
| 44 | cl, err := client.New(config.GetConfigOrDie(), client.Options{}) |
| 45 | if err != nil { |
| 46 | fmt.Println("failed to create client") |
| 47 | os.Exit(1) |
| 48 | } |
| 49 | |
| 50 | podList := &corev1.PodList{} |
| 51 | |
| 52 | err = cl.List(context.Background(), podList, client.InNamespace("default")) |
| 53 | if err != nil { |
| 54 | fmt.Printf("failed to list pods in namespace default: %v\n", err) |
| 55 | os.Exit(1) |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | func ExampleNew_suppress_warnings() { |
| 60 | cfg := config.GetConfigOrDie() |
nothing calls this directly
no test coverage detected
searching dependent graphs…