diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 7aa24c42..22110d93 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,6 +1,5 @@ ---- name: Go -"on": +on: push: branches: [main] pull_request: @@ -11,7 +10,7 @@ permissions: env: # Minimum supported Go toolchain - ACTION_MINIMUM_TOOLCHAIN: "1.12" + ACTION_MINIMUM_TOOLCHAIN: "1.12.x" jobs: build: @@ -19,14 +18,14 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: ['1.17', '1.18'] + go: ['1.17.x', '1.18.x', '1.19.x'] steps: - run: sudo apt-get -qq update - name: Install libsystemd-dev run: sudo apt-get install libsystemd-dev - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup go - uses: actions/setup-go@v1 + uses: actions/setup-go@v3 with: go-version: ${{ matrix.go }} - name: Go fmt @@ -44,9 +43,9 @@ jobs: - run: sudo apt-get -qq update - name: Install libsystemd-dev run: sudo apt-get install libsystemd-dev - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup go - uses: actions/setup-go@v1 + uses: actions/setup-go@v3 with: go-version: ${{ env['ACTION_MINIMUM_TOOLCHAIN'] }} - name: Go fmt diff --git a/daemon/watchdog.go b/daemon/watchdog.go index 7a0e0d3a..25d9c1aa 100644 --- a/daemon/watchdog.go +++ b/daemon/watchdog.go @@ -30,8 +30,8 @@ import ( // It returns one of the following: // (0, nil) - watchdog isn't enabled or we aren't the watched PID. // (0, err) - an error happened (e.g. error converting time). -// (time, nil) - watchdog is enabled and we can send ping. -// time is delay before inactive service will be killed. +// (time, nil) - watchdog is enabled and we can send ping. time is delay +// before inactive service will be killed. func SdWatchdogEnabled(unsetEnvironment bool) (time.Duration, error) { wusec := os.Getenv("WATCHDOG_USEC") wpid := os.Getenv("WATCHDOG_PID") diff --git a/internal/dlopen/dlopen_test.go b/internal/dlopen/dlopen_test.go index 60d88fa4..b9017b70 100644 --- a/internal/dlopen/dlopen_test.go +++ b/internal/dlopen/dlopen_test.go @@ -11,6 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + package dlopen import ( diff --git a/unit/escape.go b/unit/escape.go index 63b11726..98e2044a 100644 --- a/unit/escape.go +++ b/unit/escape.go @@ -27,14 +27,15 @@ const ( ) // If isPath is true: -// We remove redundant '/'s, the leading '/', and trailing '/'. -// If the result is empty, a '/' is inserted. +// +// We remove redundant '/'s, the leading '/', and trailing '/'. +// If the result is empty, a '/' is inserted. // // We always: -// Replace the following characters with `\x%x`: -// Leading `.` -// `-`, `\`, and anything not in this set: `:-_.\[0-9a-zA-Z]` -// Replace '/' with '-'. +// +// Replace the following characters with `\x%x`: Leading `.`, +// `-`, `\`, and anything not in this set: `:-_.\[0-9a-zA-Z]` +// Replace '/' with '-'. func escape(unescaped string, isPath bool) string { e := []byte{} inSlashes := false @@ -69,11 +70,13 @@ func escape(unescaped string, isPath bool) string { } // If isPath is true: -// We always return a string beginning with '/'. +// +// We always return a string beginning with '/'. // // We always: -// Replace '-' with '/'. -// Replace `\x%x` with the value represented in hex. +// +// Replace '-' with '/'. +// Replace `\x%x` with the value represented in hex. func unescape(escaped string, isPath bool) string { u := []byte{} for i := 0; i < len(escaped); i++ {