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

link: rename First, Last to Head, Tail #1232

Merged
merged 2 commits into from
Nov 24, 2023
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
3 changes: 1 addition & 2 deletions .github/workflows/apidiff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ jobs:

- name: Run go-apidiff
id: apidiff
continue-on-error: true
uses: joelanford/go-apidiff@main

- name: Create apidiff.json
if: always()
run: |
echo '{"id": ${{ github.event.pull_request.number }}, "semver-type": "${{ steps.apidiff.outputs.semver-type }}"}' > apidiff.json

- name: Upload apidiff.json
if: always()
uses: actions/upload-artifact@v3
with:
name: apidiff
Expand Down
6 changes: 4 additions & 2 deletions link/anchor.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ func (firstAnchor) anchor() (fdOrID, flags uint32, _ error) {
return 0, sys.BPF_F_BEFORE, nil
}

func First() Anchor {
// Head is the position before all other programs or links.
func Head() Anchor {
return firstAnchor{}
}

Expand All @@ -45,7 +46,8 @@ func (lastAnchor) anchor() (fdOrID, flags uint32, _ error) {
return 0, sys.BPF_F_AFTER, nil
}

func Last() Anchor {
// Tail is the position after all other programs or links.
func Tail() Anchor {
return lastAnchor{}
}

Expand Down
4 changes: 2 additions & 2 deletions link/program_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ func TestRawAttachProgramAnchor(t *testing.T) {
b := mustLoadProgram(t, ebpf.SchedCLS, 0, "")

for _, anchor := range []Anchor{
First(),
Last(),
Head(),
Tail(),
AfterProgram(a),
AfterProgramByID(aID),
AfterLink(link),
Expand Down
4 changes: 2 additions & 2 deletions link/tcx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ func TestTCXAnchor(t *testing.T) {
linkID := linkInfo.ID

for _, anchor := range []Anchor{
First(),
Last(),
Head(),
Tail(),
BeforeProgram(a),
BeforeProgramByID(programID),
AfterLink(linkA),
Expand Down
Loading