Skip to content
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
7 changes: 2 additions & 5 deletions .github/workflows/go1.25.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ jobs:

build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./src
steps:
- uses: actions/checkout@v3

Expand All @@ -22,7 +19,7 @@ jobs:
go-version: '1.25'

- name: Build
run: go build -v .
run: go build -v ./...

- name: Test
run: go test -v .
run: go test -v ./...
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
.claude/
*.exe
.env
fmsgd
/cmd/fmsgd/fmsgd
8 changes: 5 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ All code MUST conform to the specification. When in doubt, re-read SPEC.md and f
## Build & Test

- Language: Go
- Module path: `src/`
- Build: `cd src && go build ./...`
- Test: `cd src && go test ./...`
- Module path: repo root (`go.mod` at `fmsgd/go.mod`)
- Binary source: `cmd/fmsgd/`
- Shared protocol package: `pkg/fmsg/`
- Build: `go build ./...` (from repo root)
- Test: `go test ./...` (from repo root)
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ Implementation of [fmsg](https://github.com/markmnl/fmsg) host written in Go! Us
Tested with Go 1.25 on Linux and Windows, AMD64 and ARM

1. Clone this repository
2. Navigate to src/
2. Run `go build .`
2. Run `go build ./cmd/fmsgd/`


## Environment
Expand Down
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions cmd/fmsgd/defs.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package main

import "github.com/markmnl/fmsgd/pkg/fmsg"

// Type aliases so all internal code continues to use unqualified names.
type FMsgAddress = fmsg.Address
type FMsgAttachmentHeader = fmsg.AttachmentHeader
type FMsgHeader = fmsg.Header

// Flag constants forwarded from the fmsg package.
const (
FlagHasPid = fmsg.FlagHasPid
FlagHasAddTo = fmsg.FlagHasAddTo
FlagCommonType = fmsg.FlagCommonType
FlagImportant = fmsg.FlagImportant
FlagNoReply = fmsg.FlagNoReply
FlagDeflate = fmsg.FlagDeflate
)
6 changes: 4 additions & 2 deletions src/defs_test.go → cmd/fmsgd/defs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"os"
"path/filepath"
"testing"

"github.com/markmnl/fmsgd/pkg/fmsg"
)

func TestAddressToString(t *testing.T) {
Expand Down Expand Up @@ -841,13 +843,13 @@ func TestHashPayloadRejectsExpandedSizeMismatch(t *testing.T) {

// Correct expanded size should succeed
var dst bytes.Buffer
if err := hashPayload(&dst, p, int64(len(wire)), true, uint32(len(plain))); err != nil {
if err := fmsg.HashPayload(&dst, p, int64(len(wire)), true, uint32(len(plain))); err != nil {
t.Fatalf("hashPayload with correct expanded size: %v", err)
}

// Wrong expanded size should fail
dst.Reset()
err := hashPayload(&dst, p, int64(len(wire)), true, uint32(len(plain))+1)
err := fmsg.HashPayload(&dst, p, int64(len(wire)), true, uint32(len(plain))+1)
if err == nil {
t.Fatal("hashPayload with wrong expanded size: expected error, got nil")
}
Expand Down
File renamed without changes.
Loading
Loading