在我的 php-cs-fixer.php 中我有这一行:
'binary_operator_spaces' => ['align_equals' => false, 'align_double_arrow' => true],
Run Code Online (Sandbox Code Playgroud)
它给了我一个错误:
The options "align_double_arrow", "align_equals" do not exist. Defined options are: "default", "operators".
Run Code Online (Sandbox Code Playgroud)
你能帮助我们operators and default实现同样的目标吗?
我有以下代码:
resp, err = http.Head("http:something.com")
if err != nil {
//do something
}
if resp.StatusCode == http.StatusOK {
// do something
}
Run Code Online (Sandbox Code Playgroud)
由于我没有阅读 的正文,因此resp我假设我不需要像 那样关闭它resp.Body.Close()。我的假设正确吗还是我应该打电话resp.Body.Close()?
我想将一个元素附加到“actors”类的每个 div 中,但是我编写的函数只在最后一个元素中添加了“actors”类的元素(我的页面中有两个)。你能帮我如何在 JS 中正确 appendChild 吗?
async function addActor() {
let actor_name = document.getElementById("actor_name").value;
let element = document.createElement("p");
element.innerHTML = `<p>${actor_name}<input id="scriptText" style="width: 40px;" type="text" name="" value="0"></p>`;
console.log(element);
let collection = document.getElementsByClassName("actors");
for(let item of collection){
await item.appendChild(element);
console.log(item.innerHTML);
}
}```
Run Code Online (Sandbox Code Playgroud)