funcinit(){ fmt.Printf("\nchorder.net/example/src2.go init() has been called.") }
funcSrc2(){ fmt.Printf("\nchorder.net/example/src2.go Src1() has been called.") }
编写代码调用这两个包中的方法:
packge_test.go
1 2 3 4 5 6 7 8
package main
import"chorder.net/example"
funcmain(){ example.Src1() example.Src2() }
执行结果:
1 2 3 4 5 6
>go run packge_test.go
chorder.net/example/src1.go init() has been called. chorder.net/example/src2.go init() has been called. chorder.net/example/src1.go Src1() has been called. chorder.net/example/src2.go Src1() has been called.
test@debian:~/TestApp$rails s => Booting Puma => Rails 6.0.2.1 application starting in development => Run `rails server --help` for more startup options Puma starting in single mode... * Version 4.3.1 (ruby 2.6.5-p114), codename: Mysterious Traveller * Min threads: 5, max threads: 5 * Environment: development * Listening on tcp://127.0.0.1:3000 * Listening on tcp://[::1]:3000 Use Ctrl-C to stop
test@debian:~/TestApp$yarn add jquery yarn add v1.21.1 [1/4] Resolving packages... [2/4] Fetching packages... info [email protected]: The platform "linux" is incompatible with this module. info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... warning " > [email protected]" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0". warning "webpack-dev-server > [email protected]" has unmet peer dependency "webpack@^4.0.0". [4/4] Building fresh packages...
success Saved lockfile. success Saved 1 new dependency. info Direct dependencies └─ [email protected] info All dependencies └─ [email protected] Done in 9.98s. test@debian:~/TestApp$yarn add bootstrap yarn add v1.21.1 [1/4] Resolving packages... [2/4] Fetching packages... info [email protected]: The platform "linux" is incompatible with this module. info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... warning " > [email protected]" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0". warning "webpack-dev-server > [email protected]" has unmet peer dependency "webpack@^4.0.0". warning " > [email protected]" has unmet peer dependency "popper.js@^1.16.0". [4/4] Building fresh packages...
success Saved lockfile. success Saved 1 new dependency. info Direct dependencies └─ [email protected] info All dependencies └─ [email protected] Done in 13.33s.
test@debian:~/TestApp$yarn add popper.js yarn add v1.21.1 [1/4] Resolving packages... warning [email protected]: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1 [2/4] Fetching packages... info [email protected]: The platform "linux" is incompatible with this module. info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... warning " > [email protected]" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0". warning "webpack-dev-server > [email protected]" has unmet peer dependency "webpack@^4.0.0". [4/4] Building fresh packages... success Saved lockfile. success Saved 1 new dependency. info Direct dependencies └─ [email protected] info All dependencies └─ [email protected] Done in 11.78s.
/* * File: app/assets/stylesheets/application.css * This is a manifest file that'll be compiled into application.css, which will include all the files * listed below. * * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's * vendor/assets/stylesheets directory can be referenced here using a relative path. * * You're free to add application-wide styles to this file and they'll appear at the bottom of the * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS * files in this directory. Styles in this file should be added after the last require_* statement. * It is generally better to create a new file per style scope. * *= require bootstrap/dist/css/bootstrap *= require_tree . *= require_self */
// This file is automatically compiled by Webpack, along with any other files // present in this directory. You're encouraged to place your actual application logic in // a relevant structure within app/javascript and only use these pack files to reference // that code so it'll be compiled.
// Uncomment to copy all static images under ../images to the output folder and reference // them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>) // or the `imagePath` JavaScript helper below. // // const images = require.context('../images', true) // const imagePath = (name) => images(name, true)
// This file is automatically compiled by Webpack, along with any other files // present in this directory. You're encouraged to place your actual application logic in // a relevant structure within app/javascript and only use these pack files to reference // that code so it'll be compiled.
// Uncomment to copy all static images under ../images to the output folder and reference // them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>) // or the `imagePath` JavaScript helper below. // // const images = require.context('../images', true) // const imagePath = (name) => images(name, true)
root=# CREATETABLE xxx ( id SERIAL PRIMARY KEY , name CHAR(15) NOTNULL ); CREATETABLE root=# CREATEUSER test PASSWORD 'test'; CREATE ROLE root=# GRANTALLON xxx TO test; GRANT root=# DROPUSER test; ERROR: role "test" cannot be dropped because some objects depend on it DETAIL: privileges fortable xxx
可以通过下面这条语句查询PG中“test”用户的权限,并根据查询到的结果撤销之。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
root=# SELECT*FROM information_schema.table_privileges WHERE grantee='test'; grantor | grantee | table_catalog | table_schema | table_name | privilege_type | is_grantable | with_hierarchy ---------+---------+---------------+--------------+------------+----------------+--------------+---------------- root | test | root | public | xxx |INSERT|NO|NO root | test | root | public | xxx |SELECT|NO| YES root | test | root | public | xxx |UPDATE|NO|NO root | test | root | public | xxx |DELETE|NO|NO root | test | root | public | xxx |TRUNCATE|NO|NO root | test | root | public | xxx |REFERENCES|NO|NO root | test | root | public | xxx |TRIGGER|NO|NO (7rows)
root=# REVOKEALLON xxx FROM test; REVOKE root=# DROPUSER test; DROP ROLE root=#
批量撤销用户在数据库中所有表的权限:
1 2
revokeallon database XX from test; revokeallonall tables in schema public from test;
Open Task manager, kill explorer.exe (keep the powershell console open) Back on the prompt, type: cd $Env:localappdata\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy If the previous command succesfully put you on AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy directory inside your profile dir, then run: Remove-Item -Recurse -Force .\TempState\ Start explorer.exe back up from task manager (File -> New Task) The rogue start menu item should be gone.
[root@localhost ~ ]# gem install sassc Building native extensions. This could take a while... ERROR: Error installing sassc: ERROR: Failed to build gem native extension.
current directory: /usr/local/rvm/gems/ruby-2.6.2/gems/sassc-2.0.1/ext /usr/local/rvm/rubies/ruby-2.6.2/bin/ruby -rrubygems /usr/local/rvm/rubies/ruby-2.6.2/lib/ruby/gems/2.6.0/gems/rake-12.3.2/exe/rake RUBYARCHDIR\=/usr/local/rvm/gems/ruby-2.6.2/extensions/x86_64-linux/2.6.0/sassc-2.0.1 RUBYLIBDIR\=/usr/local/rvm/gems/ruby-2.6.2/extensions/x86_64-linux/2.6.0/sassc-2.0.1 cd libsass make lib/libsass.so mkdir lib cc -Wall -O2 -I /usr/local/rvm/gems/ruby-2.6.2/gems/sassc-2.0.1/ext/libsass/include -fPIC -fPIC -c -o src/cencode.o src/cencode.c src/cencode.c: In function ‘base64_encode_block’: src/cencode.c:50: warning: empty declaration src/cencode.c:64: warning: empty declaration g++ -Wall -O2 -std=c++0x -I /usr/local/rvm/gems/ruby-2.6.2/gems/sassc-2.0.1/ext/libsass/include -fPIC -fPIC -c -o src/ast.o src/ast.cpp In file included from src/ast.cpp:2: src/ast.hpp: In member function ‘virtual size_t Sass::Vectorized<T>::hash()’: src/ast.hpp:336: error: expected initializer before ‘:’ token src/ast.hpp:339: error: expected primary-expression before ‘}’ token src/ast.hpp:339: error: expected ‘;’ before ‘}’ token src/ast.hpp:339: error: expected primary-expression before ‘}’ token src/ast.hpp:339: error: expected ‘)’ before ‘}’ token src/ast.hpp:339: error: expected primary-expression before ‘}’ token src/ast.hpp:339: error: expected ‘;’ before ‘}’ token src/ast.hpp: In constructor ‘Sass::Hashed::Hashed(size_t)’: src/ast.hpp:373: error: ‘class Sass::ExpressionMap’ has no member named ‘reserve’ src/ast.hpp: In member function ‘Sass::Hashed& Sass::Hashed::operator+=(Sass::Hashed*)’: src/ast.hpp:402: error: expected initializer before ‘:’ token src/ast.hpp:406: error: could not convert ‘Sass::Hashed::reset_duplicate_key()’ to ‘bool’ src/ast.hpp:407: error: expected primary-expression before ‘return’ src/ast.hpp:407: error: expected ‘)’ before ‘return’ In file included from src/ast.cpp:2: src/ast.hpp: In member function ‘virtual size_t Sass::Map::hash()’: src/ast.hpp:1153: error: expected initializer before ‘:’ token src/ast.hpp:1157: error: expected primary-expression before ‘}’ token src/ast.hpp:1157: error: expected ‘;’ before ‘}’ token src/ast.hpp:1157: error: expected primary-expression before ‘}’ token src/ast.hpp:1157: error: expected ‘)’ before ‘}’ token src/ast.hpp:1157: error: expected primary-expression before ‘}’ token src/ast.hpp:1157: error: expected ‘;’ before ‘}’ token src/ast.hpp: In member function ‘virtual size_t Sass::Function_Call::hash()’: src/ast.hpp:1522: error: expected initializer before ‘:’ token src/ast.hpp:1524: error: expected primary-expression before ‘}’ token src/ast.hpp:1524: error: expected ‘;’ before ‘}’ token src/ast.hpp:1524: error: expected primary-expression before ‘}’ token src/ast.hpp:1524: error: expected ‘)’ before ‘}’ token src/ast.hpp:1524: error: expected primary-expression before ‘}’ token src/ast.hpp:1524: error: expected ‘;’ before ‘}’ token src/ast.hpp: In member function ‘virtual size_t Sass::Number::hash()’: src/ast.hpp:1614: error: expected initializer before ‘:’ token src/ast.hpp:1616: error: expected primary-expression before ‘for’ src/ast.hpp:1616: error: expected ‘;’ before ‘for’ src/ast.hpp:1616: error: expected primary-expression before ‘for’ src/ast.hpp:1616: error: expected ‘)’ before ‘for’ src/ast.hpp:1616: error: expected initializer before ‘:’ token src/ast.hpp:1618: error: expected primary-expression before ‘}’ token src/ast.hpp:1618: error: expected ‘;’ before ‘}’ token src/ast.hpp:1618: error: expected primary-expression before ‘}’ token src/ast.hpp:1618: error: expected ‘)’ before ‘}’ token src/ast.hpp:1618: error: expected primary-expression before ‘}’ token src/ast.hpp:1618: error: expected ‘;’ before ‘}’ token src/ast.hpp: In member function ‘bool Sass::String_Schema::has_interpolants()’: src/ast.hpp:1791: error: expected initializer before ‘:’ token src/ast.hpp:1794: error: expected primary-expression before ‘return’ src/ast.hpp:1794: error: expected ‘;’ before ‘return’ src/ast.hpp:1794: error: expected primary-expression before ‘return’ src/ast.hpp:1794: error: expected ‘)’ before ‘return’ src/ast.hpp: In member function ‘virtual size_t Sass::String_Schema::hash()’: src/ast.hpp:1801: error: expected initializer before ‘:’ token src/ast.hpp:1803: error: expected primary-expression before ‘}’ token src/ast.hpp:1803: error: expected ‘;’ before ‘}’ token src/ast.hpp:1803: error: expected primary-expression before ‘}’ token src/ast.hpp:1803: error: expected ‘)’ before ‘}’ token src/ast.hpp:1803: error: expected primary-expression before ‘}’ token src/ast.hpp:1803: error: expected ‘;’ before ‘}’ token src/ast.hpp: In member function ‘virtual size_t Sass::Compound_Selector::hash()’: src/ast.hpp:2750: error: ‘template<class T> class Sass::Vectorized’ used without template parameters src/ast.hpp: In member function ‘virtual size_t Sass::Selector_List::hash()’: src/ast.hpp:2997: error: ‘template<class T> class Sass::Vectorized’ used without template parameters src/ast.hpp: In member function ‘virtual void Sass::Selector_List::set_media_block(Sass::Media_Block*)’: src/ast.hpp:3014: error: expected initializer before ‘:’ token src/ast.hpp:3017: error: expected primary-expression before ‘}’ token src/ast.hpp:3017: error: expected ‘;’ before ‘}’ token src/ast.hpp:3017: error: expected primary-expression before ‘}’ token src/ast.hpp:3017: error: expected ‘)’ before ‘}’ token src/ast.hpp:3017: error: expected primary-expression before ‘}’ token src/ast.hpp:3017: error: expected ‘;’ before ‘}’ token src/ast.hpp: In member function ‘virtual bool Sass::Selector_List::has_placeholder()’: src/ast.hpp:3019: error: expected initializer before ‘:’ token src/ast.hpp:3022: error: expected primary-expression before ‘return’ src/ast.hpp:3022: error: expected ‘;’ before ‘return’ src/ast.hpp:3022: error: expected primary-expression before ‘return’ src/ast.hpp:3022: error: expected ‘)’ before ‘return’ src/ast.cpp: In member function ‘virtual bool Sass::Selector_List::find(bool (*)(Sass::AST_Node_Obj))’: src/ast.cpp:35: error: expected initializer before ‘:’ token src/ast.cpp:39: error: expected primary-expression before ‘return’ src/ast.cpp:39: error: expected ‘;’ before ‘return’ src/ast.cpp:39: error: expected primary-expression before ‘return’ src/ast.cpp:39: error: expected ‘)’ before ‘return’ src/ast.cpp: In member function ‘virtual bool Sass::Compound_Selector::find(bool (*)(Sass::AST_Node_Obj))’: src/ast.cpp:45: error: expected initializer before ‘:’ token src/ast.cpp:49: error: expected primary-expression before ‘return’ src/ast.cpp:49: error: expected ‘;’ before ‘return’ src/ast.cpp:49: error: expected primary-expression before ‘return’ src/ast.cpp:49: error: expected ‘)’ before ‘return’ src/ast.cpp: In member function ‘virtual void Sass::Arguments::set_delayed(bool)’: src/ast.cpp:98: error: expected initializer before ‘:’ token src/ast.cpp:102: error: expected primary-expression before ‘}’ token src/ast.cpp:102: error: expected ‘)’ before ‘}’ token src/ast.cpp:102: error: expected primary-expression before ‘}’ token src/ast.cpp:102: error: expected ‘;’ before ‘}’ token src/ast.cpp: In member function ‘virtual bool Sass::Compound_Selector::has_parent_ref() const’: src/ast.cpp:171: error: expected initializer before ‘:’ token src/ast.cpp:174: error: expected primary-expression before ‘return’ src/ast.cpp:174: error: expected ‘;’ before ‘return’ src/ast.cpp:174: error: expected primary-expression before ‘return’ src/ast.cpp:174: error: expected ‘)’ before ‘return’ src/ast.cpp: In member function ‘virtual bool Sass::Compound_Selector::has_real_parent_ref() const’: src/ast.cpp:179: error: expected initializer before ‘:’ token src/ast.cpp:182: error: expected primary-expression before ‘return’ src/ast.cpp:182: error: expected ‘;’ before ‘return’ src/ast.cpp:182: error: expected primary-expression before ‘return’ src/ast.cpp:182: error: expected ‘)’ before ‘return’ src/ast.cpp: In member function ‘virtual bool Sass::Compound_Selector::is_superselector_of(Sass::Selector_List_Obj, std::string)’: src/ast.cpp:846: error: expected initializer before ‘:’ token src/ast.cpp:849: error: expected primary-expression before ‘return’ src/ast.cpp:849: error: expected ‘;’ before ‘return’ src/ast.cpp:849: error: expected primary-expression before ‘return’ src/ast.cpp:849: error: expected ‘)’ before ‘return’ src/ast.cpp: In member function ‘Sass::Selector_List* Sass::Complex_Selector::resolve_parent_refs(std::vector<Sass::SharedImpl<Sass::Selector_List>, std::allocator<Sass::SharedImpl<Sass::Selector_List> > >&, Sass::Backtraces&, bool)’: src/ast.cpp:1408: error: expected initializer before ‘:’ token src/ast.cpp:2226: error: expected primary-expression at end of input src/ast.cpp:2226: error: expected ‘;’ at end of input src/ast.cpp:2226: error: expected primary-expression at end of input src/ast.cpp:2226: error: expected ‘)’ at end of input src/ast.cpp:2226: error: expected statement at end of input src/ast.cpp:2226: error: expected ‘}’ at end of input src/ast.cpp:2226: error: expected ‘}’ at end of input src/ast.cpp: At global scope: src/ast.cpp:2226: error: expected ‘}’ at end of input src/units.hpp:11: warning: ‘Sass::PI’ defined but not used make: *** [src/ast.o] Error 1 rake aborted! Command failed with status (2): [make lib/libsass.so...] /usr/local/rvm/gems/ruby-2.6.2/gems/sassc-2.0.1/lib/tasks/libsass.rb:31:in `block (2 levels) in <top (required)>' /usr/local/rvm/gems/ruby-2.6.2/gems/sassc-2.0.1/lib/tasks/libsass.rb:13:in `block (3 levels) in <top (required)>' /usr/local/rvm/gems/ruby-2.6.2/gems/sassc-2.0.1/lib/tasks/libsass.rb:12:in `block (2 levels) in <top (required)>' Tasks: TOP => lib/libsass.so (See full trace by running task with --trace)
rake failed, exit code 1
Gem files will remain installed in /usr/local/rvm/gems/ruby-2.6.2/gems/sassc-2.0.1 for inspection. Results logged to /usr/local/rvm/gems/ruby-2.6.2/extensions/x86_64-linux/2.6.0/sassc-2.0.1/gem_make.out
经排查,是因为GCC的版本过低导致的。
按照这个步骤,检查下GCC版本,如果是同样的版本和报错,那么可以参考以下的解决方法:
1 2
[root@localhost ~]# gcc --version | head -n1 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23)