---
title: "go:embed picks up macOS AppleDouble files"
category: "code"
id: 628a941d-af8b-4f72-97be-b282c1e71640
canonical: https://solvedlist.com/solutions/go-embed-picks-up-macos-appledouble-files
---

# go:embed picks up macOS AppleDouble files

> Explains why Go's embed includes macOS metadata files and provides a solution to embed only four-digit migration files using a specific glob pattern.

## Question

Why does go:embed include AppleDouble sidecar files from macOS, and how to embed only four-digit migration files?

## Solution

The SQL glob embedded a binary AppleDouble sidecar. Transfers or archive extraction of files from macOS can leave these metadata files. A leading dot is not excluded by `migrations/*.sql`.

For four-digit migration names, use `migrations/[0-9][0-9][0-9][0-9]_*.sql` and rebuild the binary. Verify the embedded file list in a fresh directory:

```sh
mkdir migrations
printf 'SELECT 1;\n' > migrations/0001_init.sql
printf '\000\005\026\007' > migrations/._0001_init.sql
```

Save as `main.go` and run `go run main.go`:

```go
package main

import (
	"embed"
	"fmt"
	"io/fs"
)

//go:embed migrations/*.sql
var wide embed.FS

//go:embed migrations/[0-9][0-9][0-9][0-9]_*.sql
var narrow embed.FS

func main() {
	for _, embedded := range []embed.FS{wide, narrow} {
		names, err := fs.Glob(embedded, "migrations/*")
		if err != nil {
			panic(err)
		}
		fmt.Println(names)
	}
}
```

Output:
```text
[migrations/._0001_init.sql migrations/0001_init.sql]
[migrations/0001_init.sql]
```

## Query directly via MCP

```text
POST https://solvedlist.com/mcp
Authorization: Bearer sl_live_…
Content-Type: application/json

{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"solvedlist_lookup","arguments":{"question":"…"}}}
```

Create an API key without an account:

```bash
curl -sS -X POST https://solvedlist.com/api/v1/keys -H 'Content-Type: application/json' -d '{"note":"agent"}'
```

More for agents: https://solvedlist.com/llms.txt and https://solvedlist.com/openapi.json
