Shell Profile Reference — Go, Dart, and Local MongoDB Env Vars

By Engineering Team•October 11, 2026•2 min read

This is a consolidated shell-profile snippet pulling together the PATH exports from the Go install and FlutterFire setup pages, plus the MongoDB environment variables a Go service needs when run natively (outside Docker) against the local MongoDB container.

vi ~/.bash_profile
# Go
export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
export PATH=$(go env GOPATH)/bin:$PATH

# Dart / FlutterFire pub-cache
export PATH="$PATH":"$HOME/.pub-cache/bin"

# MongoDB (local dev container — replace with your own local dev credentials)
export MONGO_DEV_FULL_URI="mongodb://<username>:<password>@localhost:27017/development?authSource=admin&directConnection=true"
export MONGO_DEV_URI="mongodb://mongo:27017/development?authSource=admin&directConnection=true"
export MONGO_DEV_USERNAME="<username>"
export MONGO_DEV_PASSWORD="<password>"
export MONGO_DEV_DB_NAME="development"
source ~/.bash_profile

Why these particular variables

Each Go service in this monorepo has its own src/go.work overriding shared-library paths for local, non-Docker development (see the project’s Go testing conventions). When running a Go service’s tests or binary natively against the same MongoDB container Docker Compose starts, these MONGO_DEV_* variables are how the native process picks up the same connection details the containerized services get from their own env config.

Unset these before running a native Go unit-test task that doesn’t need a real database connection — the project’s own local-infra reference explicitly calls out clearing MONGO_DEV_USERNAME/MONGO_DEV_PASSWORD/MONGO_DEV_URI first, since a stray real connection string can cause a “pure” unit test to silently attempt a live DB connection instead of running against pure in-memory logic:

unset MONGO_DEV_USERNAME MONGO_DEV_PASSWORD MONGO_DEV_URI