Skip to content

Commit

Permalink
refact: capitalize env variables to showup in documentation
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
locnnil committed Mar 27, 2024
1 parent ecc755f commit e86bb46
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
12 changes: 6 additions & 6 deletions env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit e86bb46

Please sign in to comment.