{"action":"closed","issue":{"url":"https://api.github.com/repos/golang/go/issues/17094","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/17094/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/17094/comments","events_url":"https://api.github.com/repos/golang/go/issues/17094/events","html_url":"https://github.com/golang/go/issues/17094","id":176776777,"number":17094,"title":"Proposal: add x/crypto/ssh.Session SetChannel method","user":{"login":"mehrdadrad","id":13306113,"avatar_url":"https://avatars.githubusercontent.com/u/13306113?v=3","gravatar_id":"","url":"https://api.github.com/users/mehrdadrad","html_url":"https://github.com/mehrdadrad","followers_url":"https://api.github.com/users/mehrdadrad/followers","following_url":"https://api.github.com/users/mehrdadrad/following{/other_user}","gists_url":"https://api.github.com/users/mehrdadrad/gists{/gist_id}","starred_url":"https://api.github.com/users/mehrdadrad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mehrdadrad/subscriptions","organizations_url":"https://api.github.com/users/mehrdadrad/orgs","repos_url":"https://api.github.com/users/mehrdadrad/repos","events_url":"https://api.github.com/users/mehrdadrad/events{/privacy}","received_events_url":"https://api.github.com/users/mehrdadrad/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/golang/go/labels/Proposal","name":"Proposal","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-13T23:27:55Z","updated_at":"2016-09-14T02:56:55Z","closed_at":"2016-09-14T02:56:55Z","body":"Please answer these questions before submitting your issue. Thanks!\r\n\r\n### What version of Go are you using (`go version`)?\r\n1.7\r\n\r\n### What operating system and processor architecture are you using (`go env`)?\r\nGOHOSTARCH=\"amd64\"\r\nGOHOSTOS=\"darwin\"\r\n\r\n### What did you do?\r\n\r\nIn regard to handle new session by user we need to have \"Set Channel\" method:\r\nPlease see the below proposal:\r\nadding the below to golang/crypto/ssh/session.go\r\n```\r\nfunc (s *Session) SetChannel(ch Channel) {\r\n\ts.ch = ch\r\n}\r\n```\r\n\r\nThen we can handle the \"New Session\" like below:\r\n\r\n```\r\nfunc NewSession(c *ssh.Client) (*ssh.Session, error) {\r\n\tch, _, err := c.OpenChannel(\"session\", nil)\r\n\tif err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\ts := &ssh.Session{}\r\n\ts.SetChannel(ch)\r\n\treturn s, nil\r\n}\r\n```\r\n\r\n### What did you expect to see?\r\n\r\nAbility to set session's channel\r\n\r\n### What did you see instead?\r\n\r\n\r\n"}}
{"actor":{"display_login":"bradfitz"}}