Using complete you can achive what you want:
Add to your .bashrc:
if [[ -f /path/to/your/script ]]; then
. /path/to/your/script
fi
Then run, from your home directory:
. .bashrc
Create the script /path/to/your/script, make it executable chmod +x /path/to/your/script. Put this content:
#!/bin/bash
# check that the function doesn't already exist
[[ ! -z "$(compgen -c | grep "^go$")" ]] \
&& echo "The command 'go' already exists." \
&& exit
go() {
cd /your/dir/"$1"
}
cd_my_dir() {
cd /your/dir
}
complete -d -F cd_my_dir go
Type go and press Tab twice
go <Tab> <Tab>
A list of possible directories will appear:
foo/
bar/
Start to type the beginning of a name, it will auto-complete:
go f <Tab> → go foo/
gofunction (i.e. thecdwith the hard-coded/path/to/folderprefix), not the "simple start-from-here" type of autocompletion ...