From b39e15dde5ec7b96c15da9faf4ab5892501c1aae Mon Sep 17 00:00:00 2001
From: Michael Stapelberg
+Companies often permit outgoing traffic only on the standard TCP ports 80 (HTTP)
+and 443 (HTTPS), blocking outgoing traffic on other ports, including TCP port 9418
+(git) and TCP port 22 (SSH).
+When using HTTPS instead of HTTP, git
enforces certificate validation by
+default, providing protection against man-in-the-middle, eavesdropping and tampering attacks.
+The go get
command therefore uses HTTPS for safety.
+
+If you use git
and prefer to push changes through SSH using your existing key
+it's easy to work around this. For GitHub, try one of these solutions:
+
+$ cd $GOPATH/src/github.com/username +$ git clone git@github.com:username/package.git ++
git push
to use the SSH
protocol by appending
+these two lines to ~/.gitconfig
:
++[url "git@github.com:"] + pushInsteadOf = https://github.com/ ++
+Almost never. Pointers to interface values arise only in rare, tricky situations involving +disguising an interface value's type for delayed evaluation. +
+ ++It is however a common mistake to pass a pointer to an interface value +to a function expecting an interface. The compiler will complain about this +error but the situation can still be confusing, because sometimes a +pointer +is necessary to satisfy an interface. +The insight is that although a pointer to a concrete type can satisfy +an interface, with one exception a pointer to an interface can never satisfy a interface. +
+ ++Consider the variable declaration, +
+ ++var w io.Writer ++ +
+The printing function fmt.Fprintf
takes as its first argument
+a value that satisfies io.Writer
—something that implements
+the canonical Write
method. Thus we can write
+
+fmt.Fprintf(w, "hello, world\n") ++ +
+If however we pass the address of w
, the program will not compile.
+
+fmt.Fprintf(&w, "hello, world\n") // Compile-time error. ++ +
+The one exception is that any value, even a pointer to an interface, can be assigned to
+a variable of empty interface type (interface{}
).
+Even so, it's almost certainly a mistake if the value is a pointer to an interface;
+the result can be confusing.
+
-Gccgo
has a C++ front-end with a recursive descent parser coupled to the
+Gccgo
has a front end written in C++, with a recursive descent parser coupled to the
standard GCC back end. Gc
is written in C using
yacc
/bison
for the parser.
Although it's a new program, it fits in the Plan 9 C compiler suite
--
cgit v1.2.3