-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Go Code format checker and formatter
Also formatted the files which dont adhere to go formats. Build will fail if there exists any formatting issue. Formatting is supported for bookworm as well.
- Loading branch information
1 parent
07a64ab
commit ea00a3c
Showing
37 changed files
with
2,057 additions
and
1,971 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
package common_utils | ||
|
||
const GNMI_WORK_PATH = "/tmp" | ||
package common_utils | ||
|
||
const GNMI_WORK_PATH = "/tmp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package gnmi | ||
|
||
//This file contains dummy tests for the sake of coverage and will be removed later | ||
|
||
import ( | ||
"testing" | ||
"time" | ||
|
||
spb_gnoi "github.com/sonic-net/sonic-gnmi/proto/gnoi" | ||
"golang.org/x/net/context" | ||
) | ||
|
||
func TestDummyClearNeighbor(t *testing.T) { | ||
// Start server | ||
s := createServer(t, 8081) | ||
go runServer(t, s) | ||
defer s.s.Stop() | ||
|
||
// Run Client | ||
client := createClient(t, 8081) | ||
sc := spb_gnoi.NewSonicServiceClient(client) | ||
req := &spb_gnoi.ClearNeighborsRequest{ | ||
Input: &spb_gnoi.ClearNeighborsRequest_Input{}, | ||
} | ||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) | ||
defer cancel() | ||
sc.ClearNeighbors(ctx, req) | ||
} | ||
|
||
func TestDummyCopyConfig(t *testing.T) { | ||
// Start server | ||
s := createServer(t, 8081) | ||
go runServer(t, s) | ||
defer s.s.Stop() | ||
|
||
// Run Client | ||
client := createClient(t, 8081) | ||
sc := spb_gnoi.NewSonicServiceClient(client) | ||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) | ||
defer cancel() | ||
req := &spb_gnoi.CopyConfigRequest{ | ||
Input: &spb_gnoi.CopyConfigRequest_Input{}, | ||
} | ||
sc.CopyConfig(ctx, req) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
// +build !gnmi_native_write | ||
|
||
package gnmi | ||
|
||
const ENABLE_NATIVE_WRITE = false | ||
//go:build !gnmi_native_write | ||
// +build !gnmi_native_write | ||
|
||
package gnmi | ||
|
||
const ENABLE_NATIVE_WRITE = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
// +build gnmi_native_write | ||
|
||
package gnmi | ||
|
||
const ENABLE_NATIVE_WRITE = true | ||
//go:build gnmi_native_write | ||
// +build gnmi_native_write | ||
|
||
package gnmi | ||
|
||
const ENABLE_NATIVE_WRITE = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
// +build !gnmi_translib_write | ||
|
||
package gnmi | ||
|
||
const ENABLE_TRANSLIB_WRITE = false | ||
//go:build !gnmi_translib_write | ||
// +build !gnmi_translib_write | ||
|
||
package gnmi | ||
|
||
const ENABLE_TRANSLIB_WRITE = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
// +build gnmi_translib_write | ||
|
||
package gnmi | ||
|
||
const ENABLE_TRANSLIB_WRITE = true | ||
//go:build gnmi_translib_write | ||
// +build gnmi_translib_write | ||
|
||
package gnmi | ||
|
||
const ENABLE_TRANSLIB_WRITE = true |
Oops, something went wrong.