# Making This Go Repository Private

Notes on what changes when converting this public GitHub repo to private.

## CI/CD - No Changes Required

GitHub Actions workflows continue to work because:
- `actions/checkout@v4` uses the built-in `GITHUB_TOKEN` which has access to its own repo
- No external private dependencies are required

## Local Development

### Configure Go for Private Repos

Tell Go to bypass the public module proxy:

```bash
go env -w GOPRIVATE=github.com/yourusername/go-jdenticon
```

### Git Authentication

Ensure one of these is configured:
- SSH key linked to your GitHub account
- Personal Access Token (PAT) in git credential helper
- `~/.netrc` file with GitHub credentials

## Using as a Dependency in Other Projects

Any project that imports this module needs:

1. Set `GOPRIVATE`:
   ```bash
   go env -w GOPRIVATE=github.com/yourusername/go-jdenticon
   ```

2. Configure git authentication (see above)

3. For CI in other repos, add to workflow:
   ```yaml
   - name: Configure git for private modules
     run: git config --global url."https://${{ secrets.GH_PAT }}@github.com/".insteadOf "https://github.com/"
   ```
   (Requires a `GH_PAT` secret with `repo` scope)

## What Breaks

| Feature | Status | Notes |
|---------|--------|-------|
| pkg.go.dev documentation | Unavailable | Public proxy can't access private repos |
| "Go Reference" badges | Broken | Remove from README or accept 404 |
| Codecov | May need token | Add `CODECOV_TOKEN` secret if uploads fail |
| Anonymous `go get` | Blocked | Users need authentication |

## Codecov Fix (If Needed)

If coverage uploads fail after going private:

1. Get token from codecov.io for the repo
2. Add as repository secret: `CODECOV_TOKEN`
3. Update `.github/workflows/ci.yml`:
   ```yaml
   - name: Upload coverage to Codecov
     uses: codecov/codecov-action@v4
     with:
       file: ./coverage.txt
       token: ${{ secrets.CODECOV_TOKEN }}  # Add this line
       flags: unittests
       name: codecov-umbrella
       fail_ci_if_error: false
   ```

## Reverting to Public

Simply change the repository visibility back to public in GitHub settings. No code changes required.
