From e86bb46d0453e1f69e11ce927e5ea4c6f129c9b9 Mon Sep 17 00:00:00 2001 From: Lincoln Wallace Date: Wed, 27 Mar 2024 17:52:10 -0300 Subject: [PATCH] refact: capitalize env variables to showup in documentation Go doc doesn't shows internal functions, in order to be abble to document the needed env vars it's necessary to capitalize it. Signed-off-by: Lincoln Wallace --- README.md | 2 ++ env/env.go | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5406a28..d89d4f5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Matter Snap Testing +[![Go Reference](https://pkg.go.dev/badge/github.com/canonical/matter-snap-testing.svg)](https://pkg.go.dev/github.com/canonical/matter-snap-testing) + Utility package for testing Matter snaps in Go. Test the testing utils: diff --git a/env/env.go b/env/env.go index 14f9d69..e02af92 100644 --- a/env/env.go +++ b/env/env.go @@ -8,14 +8,14 @@ import ( // Environment variables, used to override defaults const ( // Channel/Revision of the service snap (has default) - envSnapChannel = "SNAP_CHANNEL" + EnvSnapChannel = "SNAP_CHANNEL" // Path to snap instead, used for testing a local snap instead of // downloading from the store - envSnapPath = "SNAP_PATH" + EnvSnapPath = "SNAP_PATH" // Toggle the teardown operations during tests (has default) - envTeardown = "TEARDOWN" + EnvTeardown = "TEARDOWN" ) var ( @@ -47,15 +47,15 @@ func init() { // Read environment variables and perform type conversion/casting func loadEnvVars() { - if v := os.Getenv(envSnapChannel); v != "" { + if v := os.Getenv(EnvSnapChannel); v != "" { snapChannel = v } - if v := os.Getenv(envSnapPath); v != "" { + if v := os.Getenv(EnvSnapPath); v != "" { snapPath = v } - if v := os.Getenv(envTeardown); v != "" { + if v := os.Getenv(EnvTeardown); v != "" { var err error teardown, err = strconv.ParseBool(v) if err != nil {