purpleidea / mgmt

Next generation distributed, event-driven, parallel config management!
https://purpleidea.com/tags/mgmtconfig/
GNU General Public License v3.0
3.47k stars 308 forks source link

Use Go 1.20 `slices` package #738

Open frebib opened 5 months ago

frebib commented 5 months ago

This package is a drop-in replacement for a lot of the custom (duplicated) functions that perform basic slice operations via iteration.

purpleidea commented 5 months ago

Let's it at least prove it does the same thing at least once.

On Fri, Feb 9, 2024, 11:13 Joe Groocock @.***> wrote:

@.**** commented on this pull request.

In pgraph/pgraph_test.go https://github.com/purpleidea/mgmt/pull/738#discussion_r1484118053:

@@ -323,34 +323,6 @@ func TestDeleteVertex2(t *testing.T) { } }

-func TestVertexContains1(t *testing.T) {

  • v1 := NV("v1")
  • v2 := NV("v2")
  • v3 := NV("v3")
  • if VertexContains(v1, []Vertex{v1, v2, v3}) != true {

Is there much point in testing stdlib functionality? The point of this change was to reduce the amount of code we're carrying. Less code -> easier to understand/reason about

— Reply to this email directly, view it on GitHub https://github.com/purpleidea/mgmt/pull/738#discussion_r1484118053, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABA7MYUN65TYJJF6VZM67TYSXZEDAVCNFSM6AAAAABDBER2Z2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQNZSGA2TAMBUGA . You are receiving this because you commented.Message ID: @.***>