Answer the question
In order to leave comments, you need to log in
And again my hated tar with an error?
Why does panic occur when writing a header?
failed to add /root/Projects to tar: archive/tar: missed writing 443 bytes
// ...
walker := func(file string, finfo osFileInfo, err error) error {
// ...
if err := tw.WriteHeader(hdr); err != nil {
return err
}
tw.Flush()
// ...
}
Answer the question
In order to leave comments, you need to log in
Bootstrap 3.*:
<div class="container">
<div class="row">
<div class="col-lg-3"></div>
<div class="col-lg-3"></div>
<div class="col-lg-3"></div>
<div class="col-lg-3"></div>
</div>
</div>
No need for float. You do it through flex, and set the property
justify-content: space-between to the block,
then the blocks will be evenly distributed over the entire width. If you want exactly 25% width, then set flex-basis: 25% to each block.
Like this, you
leave the Logo on the left side.
The rest is placed in a common div and aligned to the right, setting the appropriate class.
You make a wrapper for each element, to which you set an indent on the left, except for the last element.
For naming classes, use BEM, it will be more clear what belongs to what
Parent display: flex
Further, if you just want to scatter it around the container without problems, justify-content: space-between
What exactly are you talking about?
There are 4 blocks, so something like this is being done:
<style>
.wrap {width:100%;margin: auto;}
.wrap .col {width:25%;float:left;}
</style>
<div class="wrap">
<div class="col">1</div>
<div class="col">2</div>
<div class="col">3</div>
<div class="col">4</div>
</div>
Not much code, but at first glance it's not a panic on write header
, but an error on try tw.Flush()
, which you haven't checked. After recording header
, you need to fill in the actual data and only then do it . You promised to fill in the data and did not fill it. Seems like it should be something liketw.Write(data []byte)
tw.Flush()
header
if err := tw.WriteHeader(hdr); err != nil {
return err
}
if n, err := tw.Write(content); err != nil { //вот это не видно как вы сделали
return err
}
if tw.Flush(); err != nil{ //и нужно проверять все ошибки
return err
}
If unimportant, try https://github.com/mholt/archiver . Or see how it's done.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question