Update tar.go

If os.OpenFile(...) returns err != nil, f will be nil. So f.Close() would cause a "nil pointer dereference".