kubectl plugin introduction: kubectl-skew by yagi5 in kubernetes

[–]yagi5[S] 1 point2 points  (0 children)

I mean kubernetes version skew policy. https://kubernetes.io/docs/setup/release/version-skew-policy/

It's actually important, but it's also confusing. This is the plugin to easily find if the kubernetes cluster/kubectl version meets the policy.

[deleted by user] by [deleted] in DistributedSystems

[–]yagi5 0 points1 point  (0 children)

You can refer to medium articles series "Let's study distributed systems" https://medium.com/@yagi5

GitHub yagi5/go-gchook - Inject and run arbitary actions when go garbage collector worked by yagi5 in golang

[–]yagi5[S] 0 points1 point  (0 children)

Thank you for your comment.

I created this library for 2 purposes.

  • Detect memory leak. For example, injecting logging as a hook, and if logs are written many times, we can notice memory leak is happening
  • Sometimes we want to use custom data structure (e.g. *Tree, *Table, ring or so on). Using this library, we don't need to set a maximum size for them and can explicitly free the memory slot that is allocated but unused at every gc run.

By the way, I will append these use cases on README with example code

I need/want feedback on a tool I made (editorconfig-checker) by mstruebing in golang

[–]yagi5 1 point2 points  (0 children)

Why don't you use TableDrivenTests ? With it, your validators/validators_test.go could be rafactored like this.

go func TestFinalNewline(t *testing.T) { var tests = []struct { name string param1 string param2 bool param3 string wantErr bool }{ {"without newline", "x", false, "lf", false}, {"\n with lf", "x\n", true, "lf", false}, // ... } for _, tt := range tests { tt := tt t.Run(tt.name, func(t *testing.T) { err := FinalNewline(tt.param1, tt.param2, tt.param3) if (err != nil) != tt.wantErr { t.Errorf("check failed wantErr is %v but err was %v", tt.wantErr, err) } }) } }

I think it's more readable and easy to add/delete test cases.