package pva

import (
	"os"
	"strings"
)

// addrsFromEnv returns addresses from EPICS_PVA_ADDR_LIST, if set.
func addrsFromEnv() []string {
	v := os.Getenv("EPICS_PVA_ADDR_LIST")
	if v == "" {
		return nil
	}
	var addrs []string
	for _, a := range strings.Fields(v) {
		if a != "" {
			addrs = append(addrs, a)
		}
	}
	return addrs
}
