MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/cpp-samples / GetEnv

Function GetEnv

getting-started/update/update_gcs_index.cc:31–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29namespace spanner = ::google::cloud::spanner;
30
31std::string GetEnv(char const* var) {
32 auto const* value = std::getenv(var);
33 if (value == nullptr) {
34 throw std::runtime_error("Environment variable " + std::string(var) +
35 " is not set");
36 }
37 return value;
38}
39
40using GetField = std::function<spanner::Value(nlohmann::json const&)>;
41

Callers 2

GetSpannerClientFunction · 0.70
mainFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected