Example of how to use stdout and stdin from other programs in golang
Requires go
go run parentprocess.go
Theory:
your git repository can have more than one remote server; In this case we want to have two:
origin)upstream)How to make a private fork from github to gitlab
| import unittest, os, os.path, sys, urllib | |
| import tornado.database | |
| import tornado.options | |
| from tornado.options import options | |
| from tornado.testing import AsyncHTTPTestCase | |
| # add application root to sys.path | |
| APP_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) | |
| sys.path.append(os.path.join(APP_ROOT, '..')) |
| package main | |
| // Restorer holds a function that can be used | |
| // to restore some previous state. | |
| type Restorer func() | |
| // Restore restores some previous state. | |
| func (r Restorer) Restore() { | |
| r() | |
| } |
| package main | |
| import ( | |
| "log" | |
| "net/mail" | |
| "encoding/base64" | |
| "net/smtp" | |
| "fmt" | |
| "strings" |