Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflows: add Go 1.19; update actions versions #406

Merged
merged 3 commits into from
Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
name: Go
"on":
on:
push:
branches: [main]
pull_request:
Expand All @@ -11,22 +10,22 @@ permissions:

env:
# Minimum supported Go toolchain
ACTION_MINIMUM_TOOLCHAIN: "1.12"
ACTION_MINIMUM_TOOLCHAIN: "1.12.x"

jobs:
build:
name: "Build"
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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions daemon/watchdog.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions internal/dlopen/dlopen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
21 changes: 12 additions & 9 deletions unit/escape.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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++ {
Expand Down