{"action":"opened","issue":{"url":"https://api.github.com/repos/giwa/isucon6q/issues/6","repository_url":"https://api.github.com/repos/giwa/isucon6q","labels_url":"https://api.github.com/repos/giwa/isucon6q/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/giwa/isucon6q/issues/6/comments","events_url":"https://api.github.com/repos/giwa/isucon6q/issues/6/events","html_url":"https://github.com/giwa/isucon6q/issues/6","id":360520939,"node_id":"MDU6SXNzdWUzNjA1MjA5Mzk=","number":6,"title":"'os.Getenv' 環境変数","user":{"login":"nogut0123","id":11402524,"node_id":"MDQ6VXNlcjExNDAyNTI0","avatar_url":"https://avatars0.githubusercontent.com/u/11402524?v=4","gravatar_id":"","url":"https://api.github.com/users/nogut0123","html_url":"https://github.com/nogut0123","followers_url":"https://api.github.com/users/nogut0123/followers","following_url":"https://api.github.com/users/nogut0123/following{/other_user}","gists_url":"https://api.github.com/users/nogut0123/gists{/gist_id}","starred_url":"https://api.github.com/users/nogut0123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nogut0123/subscriptions","organizations_url":"https://api.github.com/users/nogut0123/orgs","repos_url":"https://api.github.com/users/nogut0123/repos","events_url":"https://api.github.com/users/nogut0123/events{/privacy}","received_events_url":"https://api.github.com/users/nogut0123/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-15T08:37:52Z","updated_at":"2018-09-15T08:37:52Z","closed_at":null,"author_association":"COLLABORATOR","body":"```\r\nack  --with-filename 'os.Getenv' isuda.go\r\n```\r\n\r\n```\r\n393:\thost := os.Getenv(\"ISUDA_DB_HOST\")\r\n397:\tportstr := os.Getenv(\"ISUDA_DB_PORT\")\r\n405:\tuser := os.Getenv(\"ISUDA_DB_USER\")\r\n409:\tpassword := os.Getenv(\"ISUDA_DB_PASSWORD\")\r\n410:\tdbname := os.Getenv(\"ISUDA_DB_NAME\")\r\n425:\tisutarEndpoint = os.Getenv(\"ISUTAR_ORIGIN\")\r\n429:\tisupamEndpoint = os.Getenv(\"ISUPAM_ORIGIN\")\r\n```\r\n\r\n## 中身\r\n\r\n```\r\nhost := os.Getenv(\"ISUDA_DB_HOST\")\r\n\tif host == \"\" {\r\n\t\thost = \"localhost\"\r\n\t}\r\n\tportstr := os.Getenv(\"ISUDA_DB_PORT\")\r\n\tif portstr == \"\" {\r\n\t\tportstr = \"3306\"\r\n\t}\r\n\tport, err := strconv.Atoi(portstr)\r\n\tif err != nil {\r\n\t\tlog.Fatalf(\"Failed to read DB port number from an environment variable ISUDA_DB_PORT.\\nError: %s\", err.Error())\r\n\t}\r\n\tuser := os.Getenv(\"ISUDA_DB_USER\")\r\n\tif user == \"\" {\r\n\t\tuser = \"root\"\r\n\t}\r\n\tpassword := os.Getenv(\"ISUDA_DB_PASSWORD\")\r\n\tdbname := os.Getenv(\"ISUDA_DB_NAME\")\r\n\tif dbname == \"\" {\r\n\t\tdbname = \"isuda\"\r\n\t}\r\nisutarEndpoint = os.Getenv(\"ISUTAR_ORIGIN\")\r\n\tif isutarEndpoint == \"\" {\r\n\t\tisutarEndpoint = \"http://localhost:5001\"\r\n\t}\r\n\tisupamEndpoint = os.Getenv(\"ISUPAM_ORIGIN\")\r\n\tif isupamEndpoint == \"\" {\r\n\t\tisupamEndpoint = \"http://localhost:5050\"\r\n\t}\r\n```"}}
{"actor":{"display_login":"nogut0123"}}